mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
continue fighting with webpack/ts configs
This commit is contained in:
parent
a11d67090a
commit
7efc54424a
@ -2,7 +2,8 @@
|
||||
const path = require("path");
|
||||
|
||||
module.exports = function (config, env) {
|
||||
const {rules} = config.module;
|
||||
const {module, plugins} = config;
|
||||
const {rules} = module;
|
||||
|
||||
// localization support
|
||||
// https://lingui.js.org/guides/typescript.html
|
||||
@ -13,8 +14,9 @@ module.exports = function (config, env) {
|
||||
patchLoader(".tsx", "ts-loader", loader => {
|
||||
loader.options = Object.assign({}, loader.options, {
|
||||
compilerOptions: {
|
||||
jsx: "preserve",
|
||||
target: "es2016",
|
||||
jsx: "preserve", // @lingui/babel-preset-react
|
||||
target: "es2016", // @lingui/babel-preset-react
|
||||
module: "esnext", // https://webpack.js.org/guides/code-splitting/#dynamic-imports
|
||||
}
|
||||
})
|
||||
return ["babel-loader", loader]
|
||||
@ -41,7 +43,7 @@ module.exports = function (config, env) {
|
||||
let loader = typeof loaders[index] === "string" ? {loader: loaders[index]} : loaders[index];
|
||||
loaders[index] = updater(loader);
|
||||
rule.use = loaders.flat();
|
||||
console.info(`Patched renderer's webpack loader "${loaderName}"`);
|
||||
console.info(`Patched renderer's webpack loader "${loaderName}"`, loader);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -4,6 +4,8 @@
|
||||
"baseUrl": ".",
|
||||
"outDir": "./dist",
|
||||
"jsx": "react",
|
||||
"target": "es2017",
|
||||
"module": "CommonJS",
|
||||
"lib": ["ESNext", "DOM", "DOM.Iterable"],
|
||||
"moduleResolution": "Node",
|
||||
"sourceMap": true,
|
||||
@ -26,6 +28,10 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"include": [
|
||||
"src/**/*",
|
||||
"types/*"
|
||||
],
|
||||
"ts-node": {
|
||||
"compilerOptions": {
|
||||
"module": "CommonJS"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user