Skip to content

Instantly share code, notes, and snippets.

@eseQ
Created February 19, 2018 11:50
Show Gist options
  • Save eseQ/9c26cf0c606aa25ae53583dc634d9d83 to your computer and use it in GitHub Desktop.
Save eseQ/9c26cf0c606aa25ae53583dc634d9d83 to your computer and use it in GitHub Desktop.
// apps/other/client/webpack/webpack.base.config.js
const Config = require('webpack-config').default;
const environment = require('webpack-config').environment;
const path = require('path');
const key = environment.valueOf('projectKey');
const main = environment.valueOf(key);
module.exports = new Config().merge({
entry: {
main : `${main.appPath}/startup/App`,
},
output: {
filename : main.outputFilename,
chunkFilename: main.outputChunkFilename,
path : path.resolve(main.dirname, main.outputPath),
publicPath : main.outputPublicPath,
},
});
// apps/main/client/webpack.config.js
const Config = require('webpack-config').default;
const environment = require('webpack-config').environment;
const data = {
env,
isProd,
projectKey : env.projectKey || 'sub',
webpackConfigs: '../../other/client/webpack',
main : {
dirname: __dirname,
packages,
appPath, /* string */
},
};
environment.setAll(data);
const config = new Config().extend('[webpackConfigs]/webpack.base.config.js');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment