Skip to content

Instantly share code, notes, and snippets.

@anton-gorbikov
Created July 5, 2021 21:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anton-gorbikov/63ecb12ce354171e5d9c7236464b65ac to your computer and use it in GitHub Desktop.
Save anton-gorbikov/63ecb12ce354171e5d9c7236464b65ac to your computer and use it in GitHub Desktop.
const path = require('path');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const StylelintPlugin = require('stylelint-webpack-plugin');
module.exports = {
entry: './dist/app/main.js',
devServer: {
contentBase: './dist/app',
historyApiFallback: true,
host: '0.0.0.0',
port: 4200
},
plugins: [
new CleanWebpackPlugin(),
new HtmlWebpackPlugin({
title: 'Theater',
template: './src/index.html'
}),
new StylelintPlugin({
configFile: 'stylelint.config.js',
context: './src',
files: '**/*.css',
fix: true
})
],
output: {
filename: 'main.js',
path: path.resolve(__dirname, 'dist/app')
},
module: {
rules: [{
test: /\.css$/,
use: [
'style-loader',
'css-loader',
'postcss-loader'
]
}]
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment