Skip to content
Snippets Groups Projects
Select Git revision
  • 91cc5c3759efaeb3899770f15e6bc8a647ca35f6
  • main default protected
  • scrolling
  • docs
  • deploy
  • tailwind
  • 0.2.1
  • 0.2.0
8 results

webpack.config.ts

Blame
  • 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;