Update dependencies & webpack compatibility (BREAKING CHANGES)

This commit is contained in:
QWp6t
2016-11-03 08:38:22 -07:00
parent e6f2f494b0
commit eae52fd7ea
5 changed files with 69 additions and 6053 deletions

View File

@@ -1,7 +1,6 @@
const path = require('path');
const argv = require('minimist')(process.argv.slice(2));
const glob = require('glob-all');
const merge = require('lodash/merge');
const mergeWithConcat = require('./util/mergeWithConcat');
const userConfig = require('../config');
@@ -30,19 +29,20 @@ const config = mergeWithConcat({
watch: [],
}, userConfig);
const files = glob.sync(config.copy, {
cwd: config.paths.assets,
mark: true,
}).filter(file => !((file.slice(-1) === '/') || (!file.indexOf('*') === -1)))
.map(file => path.join(config.paths.assets, file));
Object.keys(config.entry).forEach(id =>
config.entry[id].unshift(path.join(__dirname, 'public-path.js')));
module.exports = mergeWithConcat(config, {
env: merge({ production: isProduction, development: !isProduction }, argv.env),
entry: {
get files() {
return glob.sync(config.copy, {
cwd: config.paths.assets,
mark: true,
}).filter(file => !((file.slice(-1) === '/') || (!file.indexOf('*') === -1)))
.map(file => path.join(config.paths.assets, file));
},
},
env: Object.assign({ production: isProduction, development: !isProduction }, argv.env),
publicPath: `${config.publicPath}/${path.basename(config.paths.dist)}/`,
});
if (files.length) {
module.exports = mergeWithConcat(module.exports, { entry: { files } });
}