123456789101112131415161718192021222324252627282930313233 |
- const path = require('path');
- const HtmlWebpackPlugin = require('html-webpack-plugin');
- module.exports = {
- mode: 'development',
- entry: './src/main.js',
- output: {
- filename: 'main.bundle.js',
- path: path.resolve(__dirname, './dist'),
- },
- module: {
- rules: [
- {
- test: /\.css$/,
- use: ['style-loader', 'css-loader'],
- },
- ],
- },
- plugins: [
- new HtmlWebpackPlugin({
- title: '人民网',
- favicon: path.join(__dirname, './public/favicon.ico'),
- template: path.join(__dirname, './public/index.html'),
- }),
- ],
- resolve: {
- extensions: ['.js', '.jsx', '.ts', '.tsx'],
- alias: {
- '@': path.join(__dirname, './src'),
- },
- symlinks: false, // 提升编译性能
- },
- };
|