Upgrade webpack to v2 and other deps (#8491)

* update to webpack2 and other deps

* fix linting
This commit is contained in:
Matteo Pagliazzi
2017-02-15 17:24:37 +01:00
committed by GitHub
parent 20792f5455
commit 65d5bf69f6
15 changed files with 164 additions and 12938 deletions
+11 -2
View File
@@ -1,9 +1,18 @@
{
"presets": ["es2015"],
"env": {
"test": {
plugins: [
["istanbul"],
],
},
},
"presets": [
["es2015", { modules: false }],
],
"plugins": [
"transform-object-rest-spread",
"syntax-async-functions",
"transform-regenerator",
],
"comments": false
"comments": false,
}
+2 -1
View File
@@ -3,6 +3,7 @@
require('babel-register');
const config = require('../../../webpack/config');
const chromeDriverPath = require('chromedriver').path;
const seleniumServerPath = require('selenium-server').path;
// http://nightwatchjs.org/guide#settings-file
module.exports = {
@@ -12,7 +13,7 @@ module.exports = {
selenium: {
start_process: true,
server_path: 'node_modules/selenium-server/lib/runner/selenium-server-standalone-2.53.0.jar',
server_path: seleniumServerPath,
host: '127.0.0.1',
port: 4444,
cli_args: {
+5 -46
View File
@@ -3,53 +3,12 @@
// we are also using it with karma-webpack
// https://github.com/webpack/karma-webpack
const path = require('path');
const merge = require('webpack-merge');
const baseConfig = require('../../../webpack/webpack.base.conf');
const utils = require('../../../webpack/utils');
const webpack = require('webpack');
const projectRoot = path.resolve(__dirname, '../../../');
const testEnv = require('../../../webpack/config/test.env');
// Necessary for babel to respect the env version of .babelrc which is necessary
// Because inject-loader does not work with ["es2015", { modules: false }] that we use
// in order to let webpack2 handle the imports
const webpackConfig = merge(baseConfig, {
// use inline sourcemap for karma-sourcemap-loader
module: {
loaders: utils.styleLoaders(),
},
devtool: '#inline-source-map',
vue: {
loaders: {
js: 'isparta',
},
},
plugins: [
new webpack.DefinePlugin({
'process.env': testEnv,
}),
],
});
// no need for app entry during tests
delete webpackConfig.entry;
// make sure isparta loader is applied before eslint
webpackConfig.module.preLoaders = webpackConfig.module.preLoaders || [];
webpackConfig.module.preLoaders.unshift({
test: /\.js$/,
loader: 'isparta',
include: [
path.resolve(projectRoot, 'website/client'),
path.resolve(projectRoot, 'website/common'),
],
});
// only apply babel for test files when using isparta
webpackConfig.module.loaders.some((loader) => {
if (loader.loader === 'babel') {
loader.include = path.resolve(projectRoot, 'test/client/unit');
return true;
}
});
process.env.BABEL_ENV = process.env.NODE_ENV; // eslint-disable-line no-process-env
const webpackConfig = require('../../../webpack/webpack.test.conf');
module.exports = function (config) {
config.set({
+1 -1
View File
@@ -1,5 +1,5 @@
import Vue from 'vue';
import storeInjector from 'inject?-vue!client/store';
import storeInjector from 'inject-loader?-vue!client/store';
import { mapState, mapGetters, mapActions } from 'client/store';
import { flattenAndNamespace } from 'client/store/helpers/internals';