1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
   | cons fs = require('fs');
  const cleanWebpackPlugin = require('clean-webpack-plugin'); const htmlWebpackPlugin = require('html-webpack-plugin');
  module.exports = {   entry: './src/index.ts',   output: {     filename: 'index.js',     path: path.resolve(__dirname, 'lib'),   },   resolve: {     extensions: ['.ts', '.js'],   },   module: {     rules: [       {         test: /\.ts?$/,         use: 'ts-loader',         exclude: /node_modules/,       }     ],   },   devServer: {     contentBase: './lib',     hot: true,     port: 3000,   },   plugins: [     new htmlWebpackPlugin({       title: '插件库测试'     }),     new cleanWebpackPlugin(),   ],   devtool: 'inline-source-map', };
  |