Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Webpack simple configuration to serve and transpile Stimulus code.
{
"dependencies": {
"@babel/plugin-proposal-class-properties": "^7.4.0",
"stimulus": "^1.1.1",
"webpack-cli": "^3.3.0",
"webpack-dev-server": "^3.2.1"
},
"name": "development",
"version": "1.0.0",
"description": "",
"main": "webpack.config.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"watch": "webpack --watch",
"start": "webpack-dev-server --open",
"build": "webpack"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"clean-webpack-plugin": "^2.0.0",
"css-loader": "^0.28.4",
"csv-loader": "^2.1.1",
"file-loader": "^0.11.2",
"html-webpack-plugin": "^3.2.0",
"style-loader": "^0.18.2",
"webpack": "^4.29.6",
"xml-loader": "^1.2.1"
}
}
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
module.exports = {
mode: 'development',
entry: {
app: './src/index.js'
},
devtool: 'inline-source-map',
devServer: {
contentBase: './dist'
},
plugins: [
new CleanWebpackPlugin(),
new HtmlWebpackPlugin({
title: 'Development'
})
],
output: {
filename: 'natar.bundle.js',
path: path.resolve(__dirname, 'dist')
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.