var path = require('path'); var HtmlWebpackPlugin = require('html-webpack-plugin'); var 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' } ] }, 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: 'http://localhost:4000' apiUrl: '/api' }) } }