Browse Source

Migration to webpack 2 (#10)

* Initial commit

* Make `yarn run test` work

* Update webpack-dev-server
plugin-mode
Hassan Ali 8 years ago
committed by Eli Perelman
parent
commit
2cb24d34aa
  1. 1
      packages/neutrino/commands/build/index.js
  2. 2
      packages/neutrino/commands/test/index.js
  3. 8
      packages/neutrino/package.json
  4. 7
      packages/neutrino/src/mocha.js
  5. 1531
      packages/neutrino/yarn.lock

1
packages/neutrino/commands/build/index.js

@ -40,6 +40,7 @@ const build = (config, done) => {
chunks: false,
children: false
}));
done(0);
});
};

2
packages/neutrino/commands/test/index.js

@ -30,7 +30,7 @@ const node = (config, args, done) => {
module.exports = (args, done) => {
const config = getPreset(args.options.preset);
if (config.mocha) {
if (config.plugins.find(p => p.options && p.options.options && p.options.options.mocha)) {
node(config, args, done);
} else {
browser(config, args, done);

8
packages/neutrino/package.json

@ -44,15 +44,15 @@
},
"license": "MPL-2.0",
"dependencies": {
"babel-register": "6.16.3",
"babel-register": "6.22.0",
"change-case": "3.0.0",
"karma": "1.3.0",
"mocha": "3.1.2",
"resolve": "1.1.7",
"vorpal": "1.4.1",
"webpack": "1.13.2",
"webpack-dev-server": "1.16.2",
"webpack-hot-middleware": "2.13.0",
"webpack": "2.2.0",
"webpack-dev-server": "2.2.0",
"webpack-hot-middleware": "2.15.0",
"yeoman-environment": "1.6.5"
}
}

7
packages/neutrino/src/mocha.js

@ -8,14 +8,15 @@ module.exports = (config, args, done) => {
proc.kill();
}
const babelLoader = config.module.loaders.find(loader => loader.loader.includes('babel'));
const mocha = config.mocha;
const babelLoader = config.module.rules.find(r => r.use && r.use.loader && r.use.loader.includes('babel'));
const mochaLoader = config.plugins.find(p => p.options && p.options.options && p.options.options.mocha);
const mocha = mochaLoader ? mochaLoader.options.options.mocha : null;
if (args.files) {
mocha.recursive = true;
}
process.env.NEUTRINO_BABEL_CONFIG = JSON.stringify(babelLoader ? babelLoader.query : {});
process.env.NEUTRINO_BABEL_CONFIG = JSON.stringify(babelLoader ? babelLoader.use.options : {});
const argv = Object
.keys(mocha)

1531
packages/neutrino/yarn.lock

File diff suppressed because it is too large
Loading…
Cancel
Save