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