Simplified webpack config and added missing dev dep (#21)

This commit is contained in:
euvl
2017-05-15 20:03:56 +01:00
parent a726bcffd0
commit f56da68e18
2 changed files with 7 additions and 21 deletions

View File

@@ -17,7 +17,6 @@
"url": "https://github.com/euvl/vue-js-modal/issues"
},
"scripts": {
"dev": "cross-env NODE_ENV=development webpack-dev-server --open --hot",
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules"
},
"license": "MIT",
@@ -31,6 +30,7 @@
"file-loader": "^0.9.0",
"node-sass": "^4.5.0",
"sass-loader": "^5.0.1",
"vue": "^2.2.6",
"vue-hot-reload-api": "^2.0.8",
"vue-loader": "^10.0.0",
"vue-style-loader": "^2.0.0",

View File

@@ -6,7 +6,9 @@ module.exports = {
output: {
path: path.resolve(__dirname, './dist'),
publicPath: '/dist/',
filename: 'index.js'
filename: 'index.js',
library:'VueJsModal',
libraryTarget: 'umd'
},
module: {
rules: [
@@ -46,31 +48,15 @@ module.exports = {
performance: {
hints: false
},
devtool: '#eval-source-map'
}
if (process.env.NODE_ENV === 'production') {
module.exports.output = {
path:'./dist',
filename:'index.js',
library:'VueJsModal',
libraryTarget: 'umd'
}
module.exports.devtool = '#source-map'
module.exports.plugins = (module.exports.plugins || []).concat([
devtool: '#source-map',
plugins: [
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: '"production"'
}
}),
/*new webpack.optimize.UglifyJsPlugin({
sourceMap: false,
extractComments: true,
compress: false
}),*/
new webpack.LoaderOptionsPlugin({
minimize: true
})
])
]
}