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

Move tsconfig.extension.json into ts-loader's compilerOptions

Signed-off-by: Hung-Han (Henry) Chen <1474479+chenhunghan@users.noreply.github.com>
This commit is contained in:
Hung-Han (Henry) Chen 2020-11-25 16:24:54 +08:00
parent 196c891c00
commit c2e23bd609
No known key found for this signature in database
GPG Key ID: A28B7834EFA73792
2 changed files with 14 additions and 14 deletions

View File

@ -1,9 +0,0 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "CommonJS",
"declaration": true,
"sourceMap": false,
"outDir": "./src/extensions/npm/extensions/dist"
}
}

View File

@ -4,15 +4,17 @@ import webpack from "webpack";
import { sassCommonVars } from "./src/common/vars";
export default function (): webpack.Configuration {
const entry = "./src/extensions/extension-api.ts"
const outDir = "./src/extensions/npm/extensions/dist";
return {
// Compile for Electron for renderer process
// see <https://webpack.js.org/configuration/target/>
target: "electron-renderer",
entry: './src/extensions/extension-api.ts',
entry,
output: {
filename: 'extension-api.js',
// need to be an absolute path
path: path.resolve(__dirname, 'src/extensions/npm/extensions/dist/src/extensions'),
path: path.resolve(__dirname, `${outDir}/src/extensions`),
// can be use in commonjs environments
// e.g. require('@k8slens/extensions')
libraryTarget: "commonjs"
@ -23,7 +25,14 @@ export default function (): webpack.Configuration {
test: /\.tsx?$/,
loader: 'ts-loader',
options: {
configFile: 'tsconfig.extensions.json',
// !! ts-loader will use tsconfig.json at folder root
// !! changes in tsconfig.json may have side effects
// !! on '@k8slens/extensions' module
compilerOptions: {
declaration: true, // output .d.ts
sourceMap: false, // to override sourceMap: true in tsconfig.json
outDir // where the .d.ts should be located
}
}
},
// for src/renderer/components/fonts/roboto-mono-nerd.ttf
@ -41,9 +50,9 @@ export default function (): webpack.Configuration {
{
test: /\.s?css$/,
use: [
// Creates `style` nodes from JS strings
// creates `style` nodes from JS strings
"style-loader",
// Translates CSS into CommonJS
// translates CSS into CommonJS
"css-loader",
{
loader: "sass-loader",