Build update

This commit is contained in:
Jaco Greeff 2017-08-01 08:02:28 +02:00
parent 0e7c115b73
commit 317a59d550
3 changed files with 264 additions and 258 deletions

View File

@ -27,16 +27,16 @@
], ],
"scripts": { "scripts": {
"build": "npm run build:lib && npm run build:app", "build": "npm run build:lib && npm run build:app",
"build:app": "webpack --config webpack/app", "build:app": "parallel-webpack -p=2 --config webpack/app",
"build:lib": "webpack --config webpack/libraries", "build:lib": "parallel-webpack -p=2 --config webpack/libraries",
"build:markdown": "babel-node ./scripts/build-rpc-markdown.js", "build:markdown": "babel-node ./scripts/build-rpc-markdown.js",
"build:json": "babel-node ./scripts/build-rpc-json.js", "build:json": "babel-node ./scripts/build-rpc-json.js",
"build:embed": "EMBED=1 node webpack/embed", "build:embed": "EMBED=1 node webpack/embed",
"build:i18n": "npm run clean && npm run build && babel-node ./scripts/build-i18n.js", "build:i18n": "npm run clean && npm run build && babel-node ./scripts/build-i18n.js",
"ci:build": "npm run ci:build:lib && npm run ci:build:app && npm run ci:build:embed", "ci:build": "npm run ci:build:lib && npm run ci:build:app && npm run ci:build:embed",
"ci:build:app": "NODE_ENV=production webpack --config webpack/app", "ci:build:app": "NODE_ENV=production parallel-webpack -p=2 --config webpack/app",
"ci:build:lib": "NODE_ENV=production webpack --config webpack/libraries", "ci:build:lib": "NODE_ENV=production parallel-webpack -p=2 --config webpack/libraries",
"ci:build:npm": "NODE_ENV=production webpack --config webpack/npm", "ci:build:npm": "NODE_ENV=production parallel-webpack -p=2 --config webpack/npm",
"ci:build:jsonrpc": "babel-node ./scripts/build-rpc-json.js --output .npmjs/jsonrpc", "ci:build:jsonrpc": "babel-node ./scripts/build-rpc-json.js --output .npmjs/jsonrpc",
"ci:build:embed": "NODE_ENV=production EMBED=1 node webpack/embed", "ci:build:embed": "NODE_ENV=production EMBED=1 node webpack/embed",
"clean": "rm -rf ./.build ./.coverage ./.happypack ./build ./node_modules/.cache", "clean": "rm -rf ./.build ./.coverage ./.happypack ./build ./node_modules/.cache",

View File

@ -49,12 +49,17 @@ const entry = isEmbed
index: './index.js' index: './index.js'
}); });
module.exports = { module.exports = Object.keys(entry).map((entryName) => {
const entrySrc = entry[entryName];
return {
cache: !isProd, cache: !isProd,
devtool: isProd ? '#hidden-source-map' : '#source-map', devtool: isProd ? '#hidden-source-map' : '#source-map',
context: path.join(__dirname, '../src'), context: path.join(__dirname, '../src'),
entry, entry: {
[entryName]: entrySrc
},
output: { output: {
path: path.join(__dirname, '../', DEST), path: path.join(__dirname, '../', DEST),
filename: '[name].js' filename: '[name].js'
@ -263,4 +268,5 @@ module.exports = {
return plugins; return plugins;
}()) }())
}; };
});

View File

@ -24,12 +24,11 @@ const Shared = require('./shared');
const DEST = process.env.BUILD_DEST || '.build'; const DEST = process.env.BUILD_DEST || '.build';
module.exports = { module.exports = ['inject', 'parity', 'web3'].map((entryName) => {
return {
context: path.join(__dirname, '../src'), context: path.join(__dirname, '../src'),
entry: { entry: {
inject: ['./inject.js'], [entryName]: ['./inject.js']
parity: ['./inject.js'],
web3: ['./inject.js']
}, },
output: { output: {
path: path.join(__dirname, '../', DEST), path: path.join(__dirname, '../', DEST),
@ -81,4 +80,5 @@ module.exports = {
] ]
}, },
plugins: Shared.getPlugins() plugins: Shared.getPlugins()
}; };
});