| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- const HtmlWebpackPlugin = require('html-webpack-plugin');
- const path = require('path');
- module.exports = {
- entry: './src/index.js',
- plugins: [new HtmlWebpackPlugin(
- {
- template: 'home.html'
- }
- )],
- output: {
- filename: '[name].bundle.js',
- path: path.resolve(__dirname, 'dist'),
- },
- module: {
- rules: [
- {
- test: /\.css$/,
- use: ['style-loader', 'css-loader'],
- },
- {
- test: /path\.txt/,
- use: ['file-loader'],
- },
- {
- test: /\.(js|jsx)$/,
- exclude: /node_modules/,
- use: {
- loader: 'babel-loader'
- }
- },
- {
- test: /\.(png|jp(e*)g|svg|gif)$/,
- use: [
- {
- loader: 'file-loader',
- options: {
- name: 'images/[hash]-[name].[ext]',
- },
- },
- ],
- },
- ],
- },
- resolve: {
- extensions: [".js", ".jsx"]
- },
- mode: 'production',
- performance: {
- hints: false,
- maxEntrypointSize: 512000,
- maxAssetSize: 512000
- },
- devServer:{
- compress: false,
- port: 9002,
- static: './dist',
- client:{overlay: false}
- },
- };
|