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");
|
const path = require("path");
|
||||||
|
|
||||||
module.exports = function (config, env) {
|
module.exports = function (config, env) {
|
||||||
const {rules} = config.module;
|
const {module, plugins} = config;
|
||||||
|
const {rules} = module;
|
||||||
|
|
||||||
// localization support
|
// localization support
|
||||||
// https://lingui.js.org/guides/typescript.html
|
// https://lingui.js.org/guides/typescript.html
|
||||||
@ -13,8 +14,9 @@ module.exports = function (config, env) {
|
|||||||
patchLoader(".tsx", "ts-loader", loader => {
|
patchLoader(".tsx", "ts-loader", loader => {
|
||||||
loader.options = Object.assign({}, loader.options, {
|
loader.options = Object.assign({}, loader.options, {
|
||||||
compilerOptions: {
|
compilerOptions: {
|
||||||
jsx: "preserve",
|
jsx: "preserve", // @lingui/babel-preset-react
|
||||||
target: "es2016",
|
target: "es2016", // @lingui/babel-preset-react
|
||||||
|
module: "esnext", // https://webpack.js.org/guides/code-splitting/#dynamic-imports
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
return ["babel-loader", loader]
|
return ["babel-loader", loader]
|
||||||
@ -41,7 +43,7 @@ module.exports = function (config, env) {
|
|||||||
let loader = typeof loaders[index] === "string" ? {loader: loaders[index]} : loaders[index];
|
let loader = typeof loaders[index] === "string" ? {loader: loaders[index]} : loaders[index];
|
||||||
loaders[index] = updater(loader);
|
loaders[index] = updater(loader);
|
||||||
rule.use = loaders.flat();
|
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": ".",
|
"baseUrl": ".",
|
||||||
"outDir": "./dist",
|
"outDir": "./dist",
|
||||||
"jsx": "react",
|
"jsx": "react",
|
||||||
|
"target": "es2017",
|
||||||
|
"module": "CommonJS",
|
||||||
"lib": ["ESNext", "DOM", "DOM.Iterable"],
|
"lib": ["ESNext", "DOM", "DOM.Iterable"],
|
||||||
"moduleResolution": "Node",
|
"moduleResolution": "Node",
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
@ -26,6 +28,10 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"include": [
|
||||||
|
"src/**/*",
|
||||||
|
"types/*"
|
||||||
|
],
|
||||||
"ts-node": {
|
"ts-node": {
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"module": "CommonJS"
|
"module": "CommonJS"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user