Comments (9)
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.
I created a fork with the aforementioned fixes
https://github.com/jhholm/systemjs-tools
You can try that if you want.
from systemjs-tools.
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.
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.
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.
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.
Trying it, thank you!
from systemjs-tools.
@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.
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)
- custom cert support (fix deep merge) HOT 7
- stale compiled output served by builder on subsequent rebuilds HOT 6
- Support externalized sourcemaps
- Serve doesn't work with Node.js 6 LTS HOT 2
- Can't install package HOT 6
- Support optional bundle expression config HOT 5
- Handlers documentation/support
- proxy support
- Bundling failed
- jspm.config.js not found if in a subdirectory HOT 1
- sourcemaps not preserved when serving app bundle HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from systemjs-tools.