mirror of https://gitee.com/antv-l7/antv-l7
build: worker 内联打包添补 (#1338)
This commit is contained in:
parent
7d796a1940
commit
3e7ab354ac
18
.fatherrc.ts
18
.fatherrc.ts
|
@ -1,31 +1,23 @@
|
|||
export default {
|
||||
// more father 4 config: https://github.com/umijs/father-next/blob/master/docs/config.md
|
||||
esm: {
|
||||
output:'es'
|
||||
output: 'es',
|
||||
},
|
||||
cjs: {
|
||||
output:'lib'
|
||||
output: 'lib',
|
||||
},
|
||||
transformer: 'babel',
|
||||
autoprefixer: {
|
||||
browsers: ['IE 11', 'last 2 versions'],
|
||||
},
|
||||
extraBabelPresets: [
|
||||
'@babel/preset-typescript'
|
||||
],
|
||||
extraBabelPresets: ['@babel/preset-typescript'],
|
||||
extraBabelPlugins: [
|
||||
// 开发模式下以原始文本引入,便于调试
|
||||
[
|
||||
// import glsl as raw text
|
||||
'babel-plugin-inline-import',
|
||||
{
|
||||
extensions: [
|
||||
'.glsl'
|
||||
]
|
||||
}
|
||||
],
|
||||
[
|
||||
'transform-import-css-l7'
|
||||
{ extensions: ['.glsl'] },
|
||||
],
|
||||
['transform-import-css-l7'],
|
||||
],
|
||||
};
|
||||
|
|
26
.umirc.ts
26
.umirc.ts
|
@ -10,13 +10,10 @@ export default defineConfig({
|
|||
port: '6006',
|
||||
},
|
||||
resolve: {
|
||||
includes: ['dev-demos']
|
||||
includes: ['dev-demos'],
|
||||
},
|
||||
polyfill: {
|
||||
imports: [
|
||||
'element-remove',
|
||||
'babel-polyfill',
|
||||
]
|
||||
imports: ['element-remove', 'babel-polyfill'],
|
||||
},
|
||||
targets: {
|
||||
chrome: 58,
|
||||
|
@ -30,17 +27,20 @@ export default defineConfig({
|
|||
.rule('lint')
|
||||
.test(/\.glsl$/)
|
||||
.use('babel')
|
||||
.loader('ts-shader-loader')
|
||||
.loader('ts-shader-loader');
|
||||
// 还可以创建具名use (loaders)
|
||||
},
|
||||
extraBabelPresets:[
|
||||
'@babel/preset-typescript'
|
||||
extraBabelPresets: ['@babel/preset-typescript'],
|
||||
extraBabelIncludes: [
|
||||
'@umijs/preset-dumi',
|
||||
'split-on-first',
|
||||
'query-string',
|
||||
'strict-uri-encode',
|
||||
'copy-text-to-clipboard',
|
||||
],
|
||||
extraBabelIncludes: ['@umijs/preset-dumi','split-on-first','query-string','strict-uri-encode','copy-text-to-clipboard'],
|
||||
extraBabelPlugins: [
|
||||
[
|
||||
'transform-import-css-l7'
|
||||
],
|
||||
['transform-import-css-l7'],
|
||||
['babel-plugin-inline-import', { extensions: ['.worker.js'] }],
|
||||
],
|
||||
navs: [
|
||||
null,
|
||||
|
@ -54,7 +54,7 @@ export default defineConfig({
|
|||
'react-dom': 'window.ReactDOM',
|
||||
antd: 'window.antd',
|
||||
lodash: '_',
|
||||
fetch:"window.fetch"
|
||||
fetch: 'window.fetch',
|
||||
},
|
||||
links: ['https://gw.alipayobjects.com/os/lib/antd/4.16.13/dist/antd.css'],
|
||||
scripts: [
|
||||
|
|
|
@ -1,30 +1,22 @@
|
|||
export default {
|
||||
// more father 4 config: https://github.com/umijs/father-next/blob/master/docs/config.md
|
||||
esm: {
|
||||
output:'es'
|
||||
output: 'es',
|
||||
},
|
||||
cjs: {
|
||||
output:'lib'
|
||||
output: 'lib',
|
||||
},
|
||||
autoprefixer: {
|
||||
browsers: ['IE 11', 'last 2 versions'],
|
||||
},
|
||||
extraBabelPresets: [
|
||||
'@babel/preset-typescript'
|
||||
],
|
||||
extraBabelPresets: ['@babel/preset-typescript'],
|
||||
extraBabelPlugins: [
|
||||
// 开发模式下以原始文本引入,便于调试
|
||||
[
|
||||
// import glsl as raw text
|
||||
'babel-plugin-inline-import',
|
||||
{
|
||||
extensions: [
|
||||
'.glsl'
|
||||
]
|
||||
}
|
||||
],
|
||||
[
|
||||
'transform-import-css-l7'
|
||||
{ extensions: ['.glsl', '.worker.js'] },
|
||||
],
|
||||
['transform-import-css-l7'],
|
||||
],
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue