const path = require('path'); const CopyWebpackPlugin = require('copy-webpack-plugin') const paths = { src: path.join(__dirname, 'src'), dist: path.join(__dirname, 'dist'), data: path.join(__dirname, 'data') } module.exports = { // The entry key describes the entry file where the scripts and styles should be imported to entry: ['./src/index.js'], // The output key describes the wanted output output: { filename: 'bundle.js', path: paths.dist }, // The dev server description devServer: { contentBase: paths.dist, compress: true, port: 9000 }, plugins: [ // Copy the data new CopyWebpackPlugin([ { from: paths.data, to: paths.dist + '/data' } ]) ], }