【发布时间】:2019-12-05 18:03:48
【问题描述】:
问题:
当我在运行 VS 调试器时在我的 TS 文件和 Vue 组件中设置断点时,我得到了未经验证的断点。我不知道它是否相关,但这是 Jupyter Lab 后端的 FE 代码,但我认为这不会影响 VS 调试器?我认为我的配置可能只是错误的。我还尝试在 Vue 和 TS 代码中添加“调试器”,但它们也从未受到影响。
我的尝试:
我尝试以多种方式配置启动文件
这是我的 VS 调试器的 launch.json:
{
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Remote debugging",
"sourceMaps": true,
"url": "http://localhost:8888/?token=<>",
"webRoot": "${workspaceFolder}",
"sourceMapPathOverrides": {
"*": "${webRoot}/*"
}
},
{
"type": "node",
"request": "launch",
"name": "Launch Webpack",
"program": "${workspaceFolder}",
"cwd": "${workspaceFolder}",
"sourceMaps": true
},
]
}
这是我的 TS.config
{
"compilerOptions": {
"sourceMap": true,
"strict": true,
"strictPropertyInitialization": false,
"strictFunctionTypes": false,
"module": "amd",
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"target": "es2017",
"lib": ["es2017", "dom"],
"allowJs": true,
"skipLibCheck": true,
"newLine": "LF",
"experimentalDecorators": true,
"emitDecoratorMetadata": true
},
"include": ["src/**/*"]
}
这是我的 webpack.development.js。我发布它的原因是因为我在开发工具下为它设置了源映射。
/**
* Webpack configuration for production.
*
* Optimizes and minifies bundle.
*/
const webpack = require("webpack");
const merge = require("webpack-merge");
const commonConfig = require("./webpack.common.js");
module.exports = merge.multiple(commonConfig, {
mode: "production",
devtool: "source-map",
main: {
optimization: {
minimize: true
},
plugins: [
new webpack.LoaderOptionsPlugin({
minimize: true,
debug: false
}),
new webpack.DefinePlugin({
"process.env": {
NODE_ENV: JSON.stringify("production")
}
}),
// new webpack.optimize.UglifyJsPlugin({
// beautify: false,
// compress: {
// warnings: false,
// drop_console: true
// },
// comments: false,
// sourceMap: true
// }),
new webpack.optimize.OccurrenceOrderPlugin(),
new webpack.optimize.ModuleConcatenationPlugin()
]
}
});
这是我的 webpack
// Entry point webpack config that delegates to different environments depending on the --env passed in.
module.exports = function(env) {
process.env.NODE_ENV = env;
return require(`./webpack.${env}.js`);
};
这是我的 webpack.production
/**
* Webpack configuration for production.
*
* Optimizes and minifies bundle.
*/
const webpack = require("webpack");
const merge = require("webpack-merge");
const commonConfig = require("./webpack.common.js");
module.exports = merge.multiple(commonConfig, {
mode: "production",
devtool: "source-map",
main: {
optimization: {
minimize: true
},
plugins: [
new webpack.LoaderOptionsPlugin({
minimize: true,
debug: false
}),
new webpack.DefinePlugin({
"process.env": {
NODE_ENV: JSON.stringify("production")
}
}),
// new webpack.optimize.UglifyJsPlugin({
// beautify: false,
// compress: {
// warnings: false,
// drop_console: true
// },
// comments: false,
// sourceMap: true
// }),
new webpack.optimize.OccurrenceOrderPlugin(),
new webpack.optimize.ModuleConcatenationPlugin()
]
}
});
【问题讨论】:
标签: typescript vue.js webpack jupyter jupyter-lab