Giter Site home page Giter Site logo

Comments (9)

jhholm avatar jhholm commented on July 23, 2024 1

For now it seems that if I change the following (config.js line 26 and 30):
configs.file = require(path.join('/', ...dir, 'systemjs-tools.js')).config

to
configs.file = require(path.join(...dir, 'systemjs-tools.js')).config

directory handling seems to work within Windows. Is the preceding '/' required? The variable dir contains initially process.cwd(), which should already contain the preceding / within Unix environments.

from systemjs-tools.

jhholm avatar jhholm commented on July 23, 2024 1

I created a fork with the aforementioned fixes
https://github.com/jhholm/systemjs-tools

You can try that if you want.

from systemjs-tools.

jhholm avatar jhholm commented on July 23, 2024

Doesn't work out of the box in Windows. Seems to be a problem with directory handling (\ or double \ instead of /). I managed to get stuff working (serve + live reload) with a dirty hack though.

Had to modify dist/config.js (line 40)
configs.file = require(path.join.apply(path, ['/'].concat(_toConsumableArray(dir), ['systemjs-tools.js']))).config;

and dist/index.js (line 331)
_.fileChanged = function (absolutePath) {
_.events.next({
type: 'file-changed',
absolutePath: absolutePath,
relativePath: _path2.default.relative(config.directories.root, absolutePath),
url: _path2.default.relative(config.directories.baseURL, absolutePath)
});
};

The url parameter didn't work. I just hardcoded those values for now.

from systemjs-tools.

jhholm avatar jhholm commented on July 23, 2024

This issue still persists in the new version, tested with NPM 6 and 8.
The path created for require comes now as e.g /C:/GIT/project/systemjs-tools.js, which doesn't work in Windows. So the problem seems to be that Windows also has drive letters. For now I just do a dirty .slice(1) to the _toConsumableArray(dir) to get the systemjs-tools.js location working.

I'll try to test if I can find a solution that works across all environments.

from systemjs-tools.

alexisvincent avatar alexisvincent commented on July 23, 2024

Awesome thanks, realistically I won’t be able to test windows support so if you are able to that would be awesome!

from systemjs-tools.

aluanhaddad avatar aluanhaddad commented on July 23, 2024

Thank you for this awesome tool. I want to use it.

My team works on windows.

I tried making the changes discussed but I was unable to get it working. When I run systemjs serve, I get

:: exiting :: couldn't find a valid systemjs-tools config

I am using the config file sample from the README.

from systemjs-tools.

aluanhaddad avatar aluanhaddad commented on July 23, 2024

Trying it, thank you!

from systemjs-tools.

aluanhaddad avatar aluanhaddad commented on July 23, 2024

@jhholm thanks for creating that fork. Unfortunately, I still receive the same error

:: exiting :: couldn't find a valid systemjs-tools config

It is possible I am doing something incredibly bone-headed.

I am running Windows 10 pro 64bit under NodeJS 8.7.0 and [email protected].

I installed the package using

npm install --global jhholm/systemjs-tools#master

I then created the configuration file mentioned in README
systemjs-tools.js

fs = require('fs');

// Specify keys for localhost
module.exports.config.serve.keys = {
  key: fs.readFileSync('localhost.key', 'utf-8'),
  cert: fs.readFileSync('localhost.crt', 'utf-8'),
  ca: fs.readFileSync('localhost.key', 'utf-8'),
};
module.exports.config.channel = {
  keys: module.exports.config.serve.keys
};

Then from the that file's containing directory, I ran

~C:\Source\project> systemjs serve

Thanks for your assistance.

from systemjs-tools.

jhholm avatar jhholm commented on July 23, 2024

I tested with your config file, and I get the same error. I suppose the config file might be the issue. E.g. this should work.

var fs = require("fs");

module.exports.config = {
    serve: {
        port: 8080,
        keys: {
            key: fs.readFileSync('localhost.key', 'utf-8'),
            cert: fs.readFileSync('localhost.crt', 'utf-8'),
            ca: fs.readFileSync('localhost.key', 'utf-8'),
        }
}

from systemjs-tools.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.