at the end of the day, it was inevitable

This commit is contained in:
Mo Elzubeir
2022-12-09 08:36:26 -06:00
commit 1218570914
1768 changed files with 887087 additions and 0 deletions
+49
View File
@@ -0,0 +1,49 @@
import path from 'path'
import webpack from 'webpack'
import config from '../config'
let webpackConfig = {
entry: {
vendors: [path.join(__dirname, 'vendors/vendors.js')]
},
output: {
path: config.path_dist,
filename: 'cw-[name].js',
library: '[name]'
},
plugins: [
new webpack.DefinePlugin(config.globals),
new webpack.DllPlugin({
path: path.join(config.path_dist, 'cw-[name]-manifest.json'),
name: '[name]',
context: path.resolve(__dirname, '../app')
})
],
resolve: {
root: path.resolve(__dirname, '../app'),
modulesDirectories: ['node_modules']
}
}
if (process.env.NODE_ENV === 'production') {
webpackConfig.plugins.push(
new webpack.optimize.OccurrenceOrderPlugin(),
new webpack.optimize.DedupePlugin(),
new webpack.optimize.UglifyJsPlugin({
compress: {
unused: true,
dead_code: true
}
})
)
}
const compiler = webpack(webpackConfig)
compiler.run((err, stats) => {
console.log(stats.toString({
chunks: false,
chunkModules: false,
colors: true
}))
console.log(err)
})