移除echarts和wangeditor5的cdn
This commit is contained in:
parent
9b7321d6b2
commit
ddc419bd7c
|
|
@ -211,9 +211,9 @@ module.exports = function (webpackEnv) {
|
|||
'configuration',
|
||||
'compiler.js'
|
||||
);
|
||||
const projectConfiguration =
|
||||
fs.existsSync(compilerConfigurationFile) &&
|
||||
require(compilerConfigurationFile).webpack;
|
||||
const projectConfiguration = fs.existsSync(compilerConfigurationFile) && require(compilerConfigurationFile).webpack;
|
||||
const splitChunks = projectConfiguration && projectConfiguration.splitChunks;
|
||||
const externals = projectConfiguration && projectConfiguration.externals;
|
||||
|
||||
const getOakInclude = () => {
|
||||
const result = [/oak-frontend-base/, /oak-general-business/];
|
||||
|
|
@ -340,12 +340,6 @@ module.exports = function (webpackEnv) {
|
|||
splitChunks: {
|
||||
chunks: 'async',
|
||||
cacheGroups: {
|
||||
'@wangeditor/basic-modules': {
|
||||
name: 'wangeditor_basic_modules',
|
||||
test: /@wangeditor\/basic-modules/,
|
||||
priority: 30,
|
||||
reuseExistingChunk: true,
|
||||
},
|
||||
icon_park: {
|
||||
name: 'icon_park',
|
||||
test: /@icon-park\/react/,
|
||||
|
|
@ -376,6 +370,7 @@ module.exports = function (webpackEnv) {
|
|||
priority: 10,
|
||||
reuseExistingChunk: true,
|
||||
},
|
||||
...((splitChunks && splitChunks.cacheGroups) || {})
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
@ -1018,13 +1013,12 @@ module.exports = function (webpackEnv) {
|
|||
performance: false,
|
||||
// 在非开发模式下,排除相关模块,以使用CDN加载
|
||||
externals: !isEnvDevelopment ? {
|
||||
echarts: 'echarts',
|
||||
lodash: '_',
|
||||
react: 'React',
|
||||
'react-dom': 'ReactDOM',
|
||||
'@wangeditor/editor': 'wangEditor',
|
||||
'@fingerprintjs/fingerprintjs': 'FingerprintJS',
|
||||
'bn.js': 'BN',
|
||||
...(externals || {})
|
||||
} : {},
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -240,7 +240,7 @@ async function create(dirName, cmd) {
|
|||
}
|
||||
// 获取package.json内容
|
||||
const packageJson = (0, template_1.packageJsonContent)({
|
||||
name: DEFAULT_PROJECT_NAME,
|
||||
name: DEFAULT_PROJECT_NAME, // 后面再统一rename
|
||||
version,
|
||||
description,
|
||||
cliName: config_1.CLI_NAME,
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ async function startup(path, connector, omitWatchers, omitTimers, routine) {
|
|||
}
|
||||
: serverConfiguration.cors
|
||||
? {
|
||||
origin: serverConfiguration.cors.origin,
|
||||
origin: serverConfiguration.cors.origin, //socket.io配置cors origin是支持数组和字符串
|
||||
allowedHeaders: [
|
||||
...corsHeaders.concat(connector.getCorsHeader()),
|
||||
...(serverConfiguration.cors.headers || []),
|
||||
|
|
|
|||
|
|
@ -44,13 +44,6 @@
|
|||
<script>
|
||||
window.ReactDOM || document.write('<script src="//unpkg.com/react-dom@18.2.0/umd/react-dom.production.min.js"><\/script>')
|
||||
</script>
|
||||
<script src="//cdn.staticfile.net/echarts/5.4.3/echarts.min.js"></script>
|
||||
<script>
|
||||
window.echarts || document.write('<script src="//lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/echarts/5.3.0/echarts.min.js"><\/script>')
|
||||
</script>
|
||||
<script>
|
||||
window.echarts || document.write('<script src="//unpkg.com/echarts@5.4.0/dist/echarts.min.js"><\/script>')
|
||||
</script>
|
||||
<script src="//cdn.staticfile.net/lodash.js/4.17.21/lodash.min.js"></script>
|
||||
<script>
|
||||
window._ || document.write('<script src="//lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/lodash.js/4.17.21/lodash.min.js"><\/script>')
|
||||
|
|
@ -61,16 +54,6 @@
|
|||
<script>
|
||||
window._ || document.write('<script src="//unpkg.com/lodash@4.17.21/lodash.js"><\/script>')
|
||||
</script>
|
||||
<!-- <link href="//unpkg.com/@wangeditor/editor@5.1.22/dist/css/style.css" rel="stylesheet">
|
||||
<script src="//unpkg.com/@wangeditor/editor@5.1.22/dist/index.js"></script> -->
|
||||
<link href="//cdn.staticfile.net/wangeditor5/5.1.22/css/style.min.css" rel="stylesheet" />
|
||||
<script src="//cdn.staticfile.net/wangeditor5/5.1.22/index.js"></script>
|
||||
<script>
|
||||
window.wangEditor || document.write('<script src="//cdn.bootcdn.net/ajax/libs/wangeditor5/5.1.22/index.min.js"><\/script>')
|
||||
</script>
|
||||
<script>
|
||||
window.wangEditor || document.write('<script src="//unpkg.com/@wangeditor/editor@5.1.22/dist/index.js"><\/script>')
|
||||
</script>
|
||||
<script src="//unpkg.com/@fingerprintjs/fingerprintjs@3.3.6/dist/fp.min.js"></script>
|
||||
<script>
|
||||
window.FingerprintJS || document.write('<script src="//cdn.jsdelivr.net/npm/@fingerprintjs/fingerprintjs@3.3.6/dist/fp.min.js"><\/script>')
|
||||
|
|
|
|||
Loading…
Reference in New Issue