GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — ToolGood.Algorithm/JavaScript.Fast/webpack.config.js at master · toolgood/ToolGood.Algorithm Expand file tree/ Copy pathwebpack.config.jsMore file actions 121 lines (118 loc) · 3.07 KB / Copy pathwebpack.config.jsFile metadata and controls121 lines (118 loc) · 3.07 KB 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 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 import path from 'path'; import { fileURLToPath } from 'url'; import webpack from 'webpack'; import TerserPlugin from 'terser-webpack-plugin'; import fs from 'fs'; const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); // 读取 license 文件内容并转换为注释格式 const licensePath = path.resolve(__dirname, '../license.md'); const licenseContent = fs.readFileSync(licensePath, 'utf8'); const licenseComment = `/*!\n${licenseContent.split('\n').map(line => ` * ${line}`).join('\n')}\n */`; export default { mode: 'production', entry: './src/index.js', output: { path: path.resolve(__dirname, 'dist'), filename: 'toolgood.algorithm.fast.js', library: { name: 'ToolGood.Algorithm', type: 'umd', export: 'default' }, globalObject: 'this' }, module: { rules: [ { test: /\.js$/, exclude: /node_modules/, use: { loader: 'babel-loader', options: { presets: [ [ '@babel/preset-env', { targets: { browsers: ['defaults'] }, modules: false } ] ], plugins: [ '@babel/plugin-transform-runtime', // Babel 8 移除了 preset-env 的 useBuiltIns 选项,改用独立的 corejs3 polyfill 插件 // usage-global:按需注入 core-js 全局 polyfill,等价于原 useBuiltIns: 'usage' ['babel-plugin-polyfill-corejs3', { method: 'usage-global' }] ] } } } ] }, resolve: { extensions: ['.js'], fallback: { "crypto": "crypto-browserify", "buffer": "buffer", "stream": "stream-browserify", "vm": "vm-browserify", "string_decoder": "string_decoder", "path": false, "fs": false, "net": false, "tls": false, "child_process": false } }, plugins: [ new webpack.DefinePlugin({ 'process.env': { NODE_ENV: JSON.stringify('production') }, 'process': { env: { NODE_ENV: JSON.stringify('production') }, version: JSON.stringify('') } }), new webpack.BannerPlugin({ banner: licenseComment, raw: true, entryOnly: true }) ], optimization: { minimize: true, usedExports: true, sideEffects: false, concatenateModules: true, minimizer: [ new TerserPlugin({ terserOptions: { mangle: { toplevel: true, safari10: false, properties: { regex: /^[a-z_][a-zA-Z0-9—_]*$|^(Get|Set|Next|F_|State)[a-zA-Z0-9—_]*$|^[A-Z]+_[A-Z0-9_]+$/,// 小写字母开头都替换 keep_quoted: false, } }, compress: { drop_console: true, drop_debugger: true, passes: 3, } } }) ] }, performance: { hints: false, maxAssetSize: 1000000, maxEntrypointSize: 1000000 } }; |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |