Merge remote-tracking branch 'upstream/master' into feature/webpack-bundle-analyzer

Conflicts:
	config/webpack.production.config.js
This commit is contained in:
orangemug
2017-11-17 10:22:28 +00:00
33 changed files with 13435 additions and 142 deletions

View File

@@ -1,6 +1,6 @@
var webpack = require("webpack");
var WebpackDevServer = require("webpack-dev-server");
var webpackConfig = require("./webpack.config");
var webpackConfig = require("./webpack.production.config");
var testConfig = require("../test/config/specs");
@@ -18,7 +18,7 @@ exports.config = {
browserName: 'firefox'
}],
sync: true,
logLevel: 'silent',
logLevel: 'verbose',
coloredLogs: true,
bail: 0,
screenshotPath: './errorShots/',
@@ -29,6 +29,9 @@ exports.config = {
services: ['phantomjs'],
framework: 'mocha',
reporters: ['spec'],
phantomjsOpts: {
webdriverLogfile: 'phantomjs.log'
},
mochaOpts: {
ui: 'bdd',
// Because we don't know how long the initial build will take...
@@ -36,9 +39,7 @@ exports.config = {
},
onPrepare: function (config, capabilities) {
var compiler = webpack(webpackConfig);
server = new WebpackDevServer(compiler, {
stats: "minimal"
});
server = new WebpackDevServer(compiler, {});
server.listen(testConfig.port);
},
onComplete: function(exitCode) {

View File

@@ -45,7 +45,13 @@ module.exports = {
// serve index.html in place of 404 responses to allow HTML5 history
historyApiFallback: true,
port: PORT,
host: HOST
host: HOST,
watchOptions: {
// Disabled polling by default as it causes lots of CPU usage and hence drains laptop batteries. To enable polling add WEBPACK_DEV_SERVER_POLLING to your environment
// See <https://webpack.js.org/configuration/watch/#watchoptions-poll> for details
poll: (!!process.env.WEBPACK_DEV_SERVER_POLLING ? true : false),
watch: false
}
},
plugins: [
new webpack.NoEmitOnErrorsPlugin(),

View File

@@ -59,7 +59,7 @@ module.exports = {
tls: 'empty'
},
plugins: [
new webpack.NoErrorsPlugin(),
new webpack.NoEmitOnErrorsPlugin(),
new webpack.optimize.CommonsChunkPlugin({ name: 'vendor', filename: '[chunkhash].vendor.js' }),
new WebpackCleanupPlugin(),
new webpack.DefinePlugin({
@@ -80,7 +80,6 @@ module.exports = {
template: './src/template.html',
title: 'Maputnik'
}),
new webpack.optimize.DedupePlugin(),
new BundleAnalyzerPlugin({
analyzerMode: 'static',
defaultSizes: 'gzip',
@@ -88,6 +87,6 @@ module.exports = {
generateStatsFile: true,
reportFilename: 'bundle-stats.html',
statsFilename: 'bundle-stats.json',
}),
})
]
};