-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1b28de1
commit 2d48b77
Showing
5 changed files
with
67 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
const NODE_ENV = process.env.NODE_ENV; | ||
|
||
module.exports = { | ||
extends: ["react-app"], | ||
// ISSUE: https://github.com/facebook/create-react-app/issues/12070 --> will be fixed with next cra version | ||
parserOptions: { | ||
babelOptions: { presets: [["babel-preset-react-app", false]] }, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,16 @@ | ||
{ | ||
"i18n-ally.localesPaths": [ | ||
"src/translations/locales" | ||
] | ||
} | ||
"editor.formatOnSave": true, | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll": true | ||
}, | ||
"i18n-ally.localesPaths": [ | ||
"src/translations/locales" | ||
], | ||
"[json]": { | ||
"editor.defaultFormatter": "vscode.json-language-features", | ||
}, | ||
"[javascript]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"editor.tabSize": 2, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,38 @@ | ||
const { | ||
override, | ||
addWebpackModuleRule, | ||
} = require("customize-cra"); | ||
const { override, addWebpackModuleRule } = require("customize-cra"); | ||
|
||
const setGlobalObject = value => config => { | ||
const setGlobalObject = (value) => (config) => { | ||
// mutate config as you want | ||
config.output.globalObject = value; | ||
|
||
// return config so the next function in the pipeline receives it as argument | ||
return config | ||
} | ||
return config; | ||
}; | ||
|
||
const overrideStats = (value) => (config) => { | ||
config.stats = value; | ||
return config; | ||
}; | ||
|
||
module.exports = (config, env) => { | ||
return override( | ||
setGlobalObject('(self || this)'), | ||
setGlobalObject("(self || this)"), | ||
/*overrideStats({ | ||
children: true | ||
}),*/ // enable if you weant to see more detailed stats for debug | ||
addWebpackModuleRule({ | ||
test: /\.html$/, | ||
use: [ | ||
{loader: 'html-loader', options: { esModule: true }} | ||
] | ||
use: [{ loader: "html-loader", options: { esModule: true } }], | ||
}), | ||
addWebpackModuleRule({ | ||
test: /(\.worker|mapbox-gl-csp-worker).js$/, | ||
use: [ | ||
{ | ||
loader: 'worker-loader', | ||
loader: "worker-loader", | ||
options: { | ||
filename: "[name].[contenthash].worker.js" | ||
} | ||
filename: "[name].[contenthash].worker.js", | ||
}, | ||
}, | ||
] | ||
], | ||
}) | ||
)(config, env); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters