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

View File

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