代码拉取完成,页面将自动刷新
const fs = require("fs");
const path = require("path");
const { VueLoaderPlugin } = require("vue-loader");
const webpack = require("webpack");
const packageConfig = JSON.parse(
fs.readFileSync(path.join(__dirname, "package.json"), "utf8")
);
const externals = Object.keys(packageConfig.dependencies);
externals.push("commonjs");
externals.push("vscode");
const extensionConfig = {
entry: {
extension: path.resolve(__dirname, "src", "extension.ts"),
kconfigServer: path.resolve(__dirname, "src", "kconfig", "server.ts"),
},
output: {
path: path.resolve(__dirname, "dist"),
filename: "[name].js",
libraryTarget: "commonjs2",
devtoolModuleFilenameTemplate: "../[resource-path]",
},
target: "node",
node: {
__dirname: false,
__filename: true,
},
devtool: "source-map",
externals: [
"commonjs",
"vscode",
"applicationinsights-native-metrics",
"bufferutil",
"utf-8-validate",
],
module: {
rules: [
{
test: /\.ts$/,
exclude: /node_modules/,
use: [
{
loader: "vscode-nls-dev/lib/webpack-loader",
options: {
base: path.join(__dirname, "src"),
},
},
{
loader: "ts-loader",
options: {
compilerOptions: {
module: "es6",
},
},
},
],
},
],
},
resolve: {
extensions: [".js", ".ts"],
},
};
const webViewConfig = {
entry: {
cmakelistsEditor: path.resolve(
__dirname,
"src",
"views",
"cmakelists-editor",
"main.ts"
),
examples: path.resolve(__dirname, "src", "views", "examples", "main.ts"),
size: path.resolve(__dirname, "src", "views", "size", "main.ts"),
tracing: path.resolve(__dirname, "src", "views", "tracing", "main.ts"),
menuconfig: path.resolve(
__dirname,
"src",
"views",
"menuconfig",
"main.ts"
),
setup: path.resolve(__dirname, "src", "views", "setup", "main.ts"),
nvsPartitionTable: path.resolve(
__dirname,
"src",
"views",
"nvs-partition-table",
"main.ts"
),
newProject: path.resolve(
__dirname,
"src",
"views",
"new-project",
"main.ts"
),
sysView: path.resolve(__dirname, "src", "views", "system-view", "main.ts"),
partition_table: path.resolve(
__dirname,
"src",
"views",
"partition-table",
"main.ts"
),
project_conf: path.resolve(
__dirname,
"src",
"views",
"project-conf",
"main.ts"
),
welcomePage: path.resolve(__dirname, "src", "views", "welcome", "main.ts"),
},
output: {
path: path.resolve(__dirname, "dist", "views"),
filename: "[name]-bundle.js",
},
module: {
rules: [
{
test: /\.scss$/,
use: [
{
loader: "vue-style-loader",
},
{
loader: "css-loader",
},
{
loader: "sass-loader",
options: {
sourceMap: true,
},
},
],
},
{
test: /\.(woff(2)?|ttf|eot|svg)(\?v=\d+\.\d+\.\d+)?$/,
use: [
{
loader: "file-loader",
options: {
name: "[name].[ext]",
outputPath: "fonts",
},
},
],
},
{
test: /\.vue$/,
use: "vue-loader",
exclude: /node_modules/,
},
{
test: /\.css$/,
use: ["vue-style-loader", "css-loader"],
},
{
test: /\.tsx?$/,
use: {
loader: "ts-loader",
options: {
appendTsSuffixTo: [/\.vue$/],
},
},
exclude: /node_modules/,
},
],
},
resolve: {
conditionNames: ["import"],
extensions: [".ts", ".js", ".vue", ".json"],
alias: {
Vue: "vue/dist/vue.esm-bundler.js",
},
fallback: {
os: require.resolve("os-browserify/browser"),
path: require.resolve("path-browserify"),
stream: require.resolve("stream-browserify"),
assert: require.resolve("assert/"),
},
},
plugins: [
new VueLoaderPlugin(),
new webpack.DefinePlugin({
__VUE_OPTIONS_API__: false,
__VUE_PROD_DEVTOOLS__: false,
}),
],
devServer: {
contentBase: path.join(__dirname),
compress: true,
port: 9000,
},
};
module.exports = [extensionConfig, webViewConfig];
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。