1
0
mirror of synced 2025-11-06 04:21:11 +08:00

chore: separate polyfill

This commit is contained in:
surunzi
2023-04-01 22:46:01 +08:00
parent a23ce022f7
commit 8da9d0e87a
5 changed files with 15 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
const BundleAnalyzerPlugin =
require('webpack-bundle-analyzer').BundleAnalyzerPlugin
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer')
.BundleAnalyzerPlugin
exports = require('./webpack.prod')

10
build/webpack.polyfill.js Normal file
View File

@@ -0,0 +1,10 @@
const path = require('path')
module.exports = {
mode: 'production',
entry: './src/polyfill',
output: {
path: path.resolve(__dirname, '../dist'),
filename: 'eruda-polyfill.js',
},
}

View File

@@ -9,7 +9,7 @@
],
"scripts": {
"ci": "npm run lint && npm run test && npm run build && npm run es5",
"build": "lsla shx rm -rf dist && webpack --config build/webpack.prod.js && node build/build && lsla shx cp README.md eruda.d.ts dist",
"build": "lsla shx rm -rf dist && webpack --config build/webpack.prod.js && webpack --config build/webpack.polyfill.js && node build/build && lsla shx cp README.md eruda.d.ts dist",
"build:analyser": "webpack --config build/webpack.analyser.js",
"dev": "webpack-dev-server --config build/webpack.dev.js --host 0.0.0.0",
"test": "karma start",

View File

@@ -1,5 +1,3 @@
import 'core-js/modules/es.map'
import 'core-js/stable/promise'
import EntryBtn from './EntryBtn/EntryBtn'
import DevTools from './DevTools/DevTools'
import Tool from './DevTools/Tool'

2
src/polyfill.js Normal file
View File

@@ -0,0 +1,2 @@
import 'core-js/modules/es.map'
import 'core-js/stable/promise'