mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
allow to define bundled extensions via appStart
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
1 parent
f2cecbbcae
commit
3ed6cc3972
12 files changed
+95
-27
No files matched your search
@@ -6,9 +6,12 @@ import MiniCssExtractPlugin from "mini-css-extract-plugin";
|
||||
import nodeExternals from "webpack-node-externals";
|
||||
import { platform } from "os";
|
||||
import path from "path";
|
||||
import type { WebpackPluginInstance } from "webpack";
|
||||
import { DefinePlugin, optimize } from "webpack";
|
||||
import { main, renderer } from "./library";
|
||||
import { buildDir } from "./vars";
|
||||
import CircularDependencyPlugin from "circular-dependency-plugin";
|
||||
import ForkTsCheckerPlugin from "fork-ts-checker-webpack-plugin";
|
||||
|
||||
const config = [
|
||||
{
|
||||
@@ -30,6 +33,12 @@ const config = [
|
||||
CONTEXT_MATCHER_FOR_NON_FEATURES: `/\\.injectable(\\.${platform})?\\.tsx?$/`,
|
||||
CONTEXT_MATCHER_FOR_FEATURES: `/\\/(main|common)\\/.+\\.injectable(\\.${platform})?\\.tsx?$/`,
|
||||
}),
|
||||
new ForkTsCheckerPlugin(),
|
||||
new CircularDependencyPlugin({
|
||||
cwd: __dirname,
|
||||
exclude: /node_modules/,
|
||||
failOnError: true,
|
||||
}) as unknown as WebpackPluginInstance,
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -49,7 +58,14 @@ const config = [
|
||||
externals: [
|
||||
nodeExternals(),
|
||||
],
|
||||
plugins: [],
|
||||
plugins: [
|
||||
new ForkTsCheckerPlugin(),
|
||||
new CircularDependencyPlugin({
|
||||
cwd: __dirname,
|
||||
exclude: /node_modules/,
|
||||
failOnError: true,
|
||||
}) as unknown as WebpackPluginInstance,
|
||||
],
|
||||
},
|
||||
{
|
||||
...renderer,
|
||||
@@ -81,6 +97,12 @@ const config = [
|
||||
new optimize.LimitChunkCountPlugin({
|
||||
maxChunks: 1,
|
||||
}),
|
||||
new ForkTsCheckerPlugin(),
|
||||
new CircularDependencyPlugin({
|
||||
cwd: __dirname,
|
||||
exclude: /node_modules/,
|
||||
failOnError: true,
|
||||
}) as unknown as WebpackPluginInstance,
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
+11
-1
@@ -13,8 +13,10 @@ import { assetsFolderName, buildDir, htmlTemplate, isDevelopment, mainDir, publi
|
||||
import HtmlWebpackPlugin from "html-webpack-plugin";
|
||||
import MiniCssExtractPlugin from "mini-css-extract-plugin";
|
||||
|
||||
const defaultRendererConfig = rendererConfig({ showVars: false });
|
||||
|
||||
const renderer: webpack.Configuration = ({
|
||||
...rendererConfig({ showVars: false }),
|
||||
...defaultRendererConfig,
|
||||
plugins: [
|
||||
// see also: https://github.com/Microsoft/monaco-editor-webpack-plugin#options
|
||||
new MonacoWebpackPlugin({
|
||||
@@ -52,6 +54,9 @@ const main: webpack.Configuration = ({
|
||||
libraryTarget: "global",
|
||||
path: buildDir,
|
||||
},
|
||||
optimization: {
|
||||
minimize: false,
|
||||
},
|
||||
resolve: {
|
||||
extensions: [".json", ".js", ".ts"],
|
||||
},
|
||||
@@ -59,6 +64,11 @@ const main: webpack.Configuration = ({
|
||||
nodeExternals(),
|
||||
],
|
||||
module: {
|
||||
parser: {
|
||||
javascript: {
|
||||
commonjsMagicComments: true,
|
||||
},
|
||||
},
|
||||
rules: [
|
||||
{
|
||||
test: /\.node$/,
|
||||
|
||||
@@ -45,6 +45,11 @@ configs.push((): webpack.Configuration => {
|
||||
nodeExternals(),
|
||||
],
|
||||
module: {
|
||||
parser: {
|
||||
javascript: {
|
||||
commonjsMagicComments: true,
|
||||
},
|
||||
},
|
||||
rules: [
|
||||
{
|
||||
test: /\.node$/,
|
||||
|
||||
@@ -71,6 +71,11 @@ export function webpackLensRenderer({ showVars = true } = {}): webpack.Configura
|
||||
minimize: false,
|
||||
},
|
||||
module: {
|
||||
parser: {
|
||||
javascript: {
|
||||
commonjsMagicComments: true,
|
||||
},
|
||||
},
|
||||
rules: [
|
||||
{
|
||||
test: /\.node$/,
|
||||
|
||||
Reference in new issue
Block a user