Skip to content

Commit

Permalink
minor update to get packaging up and running again
Browse files Browse the repository at this point in the history
  • Loading branch information
Floydan committed Oct 26, 2020
1 parent 8cbfdb1 commit 78e69d5
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,16 @@ const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = (env, argsv) => {
const isDevelopment = argsv.mode !== 'production';

return {
const config = {
entry: ['./src/main.js'],
output: {
filename: `assets/js/${isDevelopment ? '[name].js' : '[name].[contenthash].js'}`,
chunkFilename: `assets/js/${isDevelopment ? '[id].js' : '[id].[contenthash].js'}`,
path: path.resolve(__dirname, 'dist'),
},
mode: argsv.mode !== 'production' ? 'development' : 'production',
devtool: argsv.mode !== 'production' ? 'source-map' : '',
mode: isDevelopment ? 'development' : 'production',
optimization: {
moduleIds: 'hashed',
moduleIds: 'deterministic',
runtimeChunk: 'single',
splitChunks: {
cacheGroups: {
Expand Down Expand Up @@ -157,5 +156,11 @@ module.exports = (env, argsv) => {
vue: 'vue/dist/vue.js'
},
},
};

if (isDevelopment) {
config.devtool = 'eval-source-map';
}

return config;
};

0 comments on commit 78e69d5

Please sign in to comment.