12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- const path = require('path');
- module.exports = (env, argv) => {
- const isProduction = argv.mode === 'production';
- return {
- entry: './src/index.ts',
- output: {
- filename: 'amf.min.js',
- path: path.resolve(__dirname, 'dist'),
- },
-
- resolve: {
- extensions: ['.ts', '.js'],
- alias: {
- '@': path.resolve(__dirname, 'src/'),
- },
- },
- module: {
- rules: [
- {
- test: /\.ts$/,
- use: 'ts-loader',
- exclude: /node_modules/,
- },
- {
- test: /\.css$/i,
- use: ['style-loader', 'css-loader'],
- },
- ],
- },
- optimization: {
- minimize: isProduction,
- },
- devServer: {
- static: path.join(__dirname, 'dist'),
- compress: true,
- port: 8080,
- open: true,
- hot: true,
- },
- };
- };
|