Skip to content

Instantly share code, notes, and snippets.

@hach-que
Created April 13, 2017 14:25
Show Gist options
  • Save hach-que/1074244fe53ad52596fdee2b84572f41 to your computer and use it in GitHub Desktop.
Save hach-que/1074244fe53ad52596fdee2b84572f41 to your computer and use it in GitHub Desktop.
const config = {
context: path.resolve(__dirname, '..'),
output: {
path: path.resolve(__dirname, '../build/public/assets'),
publicPath: '/assets/',
pathinfo: VERBOSE,
},
cache: DEBUG,
stats: {
colors: true,
reasons: DEBUG,
hash: VERBOSE,
version: VERBOSE,
timings: true,
chunks: VERBOSE,
chunkModules: VERBOSE,
cached: VERBOSE,
cachedAssets: VERBOSE,
},
resolve: {
extensions: ['.webpack.js', '.web.js', '.js', '.jsx', '.json'],
},
// ...
};
const globalClientConfig = {
...config,
name: 'global',
target: 'web',
entry: {
jquery: "./node_modules/jquery/dist/jquery.js",
bootstrap: "./node_modules/bootstrap/dist/js/bootstrap.js",
appExtra: "./node_modules/admin-lte/dist/js/app.js",
},
output: {
...config.output,
path: path.join(__dirname, '../build/public'),
filename: DEBUG ? '[name].js?[hash]' : '[name].[hash].js',
},
devtool: DEBUG ? 'source-map' : false,
module: {
rules: [
{
test: /.*$/,
loader: 'raw-loader',
}
]
},
plugins: [
// Emit a file with asset paths.
new AssetsPlugin({
path: path.resolve(__dirname, '../build'),
filename: 'assets-global.json',
prettyPrint: true,
}),
]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment