Select Git revision
webpack.config.ts

Thomas Schneider authored
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
webpack.config.ts 986 B
import * as path from 'path';
import WebpackAssetsManifest from 'webpack-assets-manifest';
import { type CallableOption } from 'webpack-cli';
const cfg: CallableOption = (_env, _argv) => ({
context: __dirname,
entry: './src/main.ts',
module: {
rules: [
{
test: /\.ts/,
use: 'ts-loader',
exclude: /node_modules/
},
{
test: /\.less$/,
use: [
'style-loader',
'css-loader',
'less-loader'
]
},
]
},
resolve: {
extensions: ['.ts', '.js', '.less', '.css']
},
output: {
filename: 'js/[name].[chunkhash].js',
path: path.resolve(__dirname, '..', 'schilder2000', 'static'),
publicPath: '/static/',
clean: process.env.NODE_ENV === 'production',
},
plugins: [
new WebpackAssetsManifest({
output: 'manifest.json',
writeToDisk: true,
publicPath: true,
entrypoints: true,
}),
],
devtool: 'source-map',
devServer: {
devMiddleware: {
writeToDisk: true,
},
static: false,
},
});
export default cfg;