diff --git a/package.json b/package.json index 632cf13..c1cd9a4 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/webpack.config.js b/webpack.config.js index 49e382e..85b1077 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -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 }) - ]) + ] }