Answer the question
In order to leave comments, you need to log in
Webpack doesn't include js file in dev development - why?
Set up a build with webpack-server:
const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')
module.exports = {
entry: './src/main.js',
output: {
filename: 'app.js',
path: path.resolve(__dirname, './public'),
publicPath: '/public/'
},
module: {
rules: [
{
test: /\.js$/,
loader: 'babel-loader',
exclude: '/node_modules/'
}
]
},
plugins: [
new HtmlWebpackPlugin({
hash: true,
template: './src/index.html',
filename: './index.html'
})
],
devServer: {
contentBase: './src',
overlay: true,
historyApiFallback: true
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question