mirror of
https://github.com/zhigang1992/create-react-app.git
synced 2026-04-28 17:35:42 +08:00
Safely assume module type for node_modules (#5052)
https://github.com/facebook/create-react-app/pull/5046#issuecomment-423501823
This commit is contained in:
@@ -32,6 +32,11 @@ module.exports = function(api, opts) {
|
||||
}
|
||||
|
||||
return {
|
||||
// Babel assumes ES Modules, which isn't safe until CommonJS
|
||||
// dies. This changes the behavior to assume CommonJS unless
|
||||
// an `import` or `export` is present in the file.
|
||||
// https://github.com/webpack/webpack/issues/4039#issuecomment-419284940
|
||||
sourceType: 'unambiguous',
|
||||
presets: [
|
||||
isEnvTest && [
|
||||
// ES features necessary for user's Node version
|
||||
|
||||
Reference in New Issue
Block a user