UNPKG

vue-codemirror-lite

Version:
58 lines (53 loc) 1.09 kB
var path = require('path') var webpack = require('webpack') var HtmlWebpackPlugin = require('html-webpack-plugin') var isProduction = process.env.NODE_ENV === 'production' var config = { entry: './demo/demo.js', output: { path: path.join(__dirname, './demo-dist'), filename: 'demo.js' }, module: { loaders: [ { test: /\.vue$/, loader: 'vue-loader' }, { test: /\.css$/, loader: 'style-loader!css-loader' } ] }, externals: { vue: 'Vue' }, plugins: [ new webpack.DefinePlugin({ 'process.env':{ 'NODE_ENV': JSON.stringify('dev') } }), new webpack.optimize.OccurrenceOrderPlugin(), new HtmlWebpackPlugin({ template: 'demo/index.html', filename: 'index.html' }) ], devServer: { contentBase: path.join(__dirname, './demo'), compress: false, port: 9090 } } if (isProduction) { config.plugins.push( new webpack.optimize.UglifyJsPlugin({ compress: { warnings: false } }) ) } module.exports = config