Closed wallance-zhang closed 3 years ago
Hi guys,
I point the exact issue at @babel/parser->lib->index.js: const keywordRelationalOperator = /in(?:stanceof)?/y; IE doesn't recognize "/y", this express is packaged into vue2-sfc-loader.js.
@babel/plugin-transform-sticky-regex (https://babeljs.io/docs/en/babel-plugin-transform-sticky-regex)
NOTE: This plugin is included in @babel/preset-env
AFAIU babel should transform this according to the browserlist. We should check if node_modules/**
files are properly processed through babel-loader.
Hi Franck,
Thanks for your help, but the issue is always here. as you mention I add some babel plugin in webpack.config.js: presets: [ ...!noPresetEnv ? [ [ '@babel/preset-env', { useBuiltIns: 'entry', // https://babeljs.io/docs/en/babel-preset-env#usebuiltins corejs: { version: 3, proposals: true }, targets: { browsers: targetsBrowsers, }, } ] ] : [], ], plugins: [ "@babel/plugin-transform-duplicate-keys", "@babel/plugin-transform-sticky-regex" ], } @in web.config set the browserslit: "browserslist": "ie 11, not dead",
But the js error is not fixed, could you please test the vue3-sfc-loader.js under IE 11?
unable to find a decent RegExp polyfill that handles sticky (y) flag (eg. RegExp("in(?:stanceof)?","y")
)
Hi Franck, I appreciate your kindly feedback,thanks for your help. It works well under IE11 apply your example. :)
Hi Franck,
I build my own version(to support IE11) use the {"browserslist": "> 1%, last 2 versions, not ie <= 10"} and {"browserslist": "defaults"}, but in IE11 always encounter js error SCRIPT5017 point to the line "vue2-sfc-loader.js (9,360569)" this error point to the vue2-sfc-loader.js.map:
parse() { this.enterInitialScopes();
const file = this.startNode();
const program = this.startNode(); this.nextToken(); file.errors = null; this.parseTopLevel(file, program); file.errors = this.state.errors; return file; }
what can I do to fix this issue?
Thanks, Wallace