const HtmlWebpackPlugin = require('html-webpack-plugin'); const CopyWebpackPlugin = require('copy-webpack-plugin'); module.exports = { mode: 'development', resolve: { extensions: ['.js', '.vue'] }, module: { rules: [ { test: /\.vue?$/, exclude: /(node_modules)/, use: 'vue-loader' }, { test: /\.js?$/, exclude: /(node_modules)/, use: 'babel-loader' }, { test: /\.(css|less)$/, use: [{ loader: "css-loader" // translates CSS into CommonJS }] } ] }, plugins: [ new HtmlWebpackPlugin({ template: './src/index.html' }), new CopyWebpackPlugin([ { from: 'src/public', to: '' } ]) ], devServer: { historyApiFallback: true }, externals: { // global app config object config: JSON.stringify({ apiUrl: '/api' }) } };