1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Add babel-loader to fxi lingui related issues

Signed-off-by: Hung-Han (Henry) Chen <1474479+chenhunghan@users.noreply.github.com>
This commit is contained in:
Hung-Han (Henry) Chen 2020-12-03 17:10:29 +08:00
parent d569c104ba
commit 78400e51fc
No known key found for this signature in database
GPG Key ID: A28B7834EFA73792

View File

@ -31,6 +31,22 @@ export default function (): webpack.Configuration {
rules: [ rules: [
{ {
test: /\.tsx?$/, test: /\.tsx?$/,
exclude: /node_modules/,
use: [
{
loader: "babel-loader",
options: {
// for lingui
// https://lingui.js.org/guides/typescript.html
// just in case these are not in .babelrc
presets: [
["@babel/preset-env"],
["@babel/preset-react"],
["@lingui/babel-preset-react"]
],
}
},
{
loader: "ts-loader", loader: "ts-loader",
options: { options: {
transpileOnly: true, transpileOnly: true,
@ -40,9 +56,15 @@ export default function (): webpack.Configuration {
compilerOptions: { compilerOptions: {
declaration: true, // output .d.ts declaration: true, // output .d.ts
sourceMap: false, // to override sourceMap: true in tsconfig.json sourceMap: false, // to override sourceMap: true in tsconfig.json
outDir // where the .d.ts should be located outDir, // where the .d.ts should be located
// for lingui
// https://lingui.js.org/guides/typescript.html
jsx: "preserve",
target: "es2016"
} }
} }
}
]
}, },
// for src/renderer/components/fonts/roboto-mono-nerd.ttf // for src/renderer/components/fonts/roboto-mono-nerd.ttf
// in src/renderer/components/dock/terminal.ts 95:25-65 // in src/renderer/components/dock/terminal.ts 95:25-65