mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-26 02:53:05 -05:00
use vscode-nls-dev-loader
This commit is contained in:
@@ -13,8 +13,8 @@ const myConfig = {
|
||||
__dirname: false // leave the __dirname-behaviour intact
|
||||
},
|
||||
entry: {
|
||||
main: './out/main.js',
|
||||
['askpass-main']: './out/askpass-main.js'
|
||||
main: './src/main.ts',
|
||||
['askpass-main']: './src/askpass-main.ts'
|
||||
},
|
||||
plugins: [
|
||||
new CopyWebpackPlugin([
|
||||
@@ -34,4 +34,4 @@ const myConfig = {
|
||||
},
|
||||
};
|
||||
|
||||
module.exports = { ...sharedConfig(__dirname, false), ...myConfig };
|
||||
module.exports = { ...sharedConfig(__dirname), ...myConfig };
|
||||
|
||||
@@ -12,17 +12,36 @@ const path = require('path');
|
||||
* returns a good default configuation for extensions that
|
||||
* want to do webpack
|
||||
*/
|
||||
module.exports = function (extensionDir, useTsLoader = true) {
|
||||
let config = {
|
||||
module.exports = function (extensionDir) {
|
||||
return {
|
||||
context: extensionDir,
|
||||
mode: 'none', // this leaves the source code as close as possible to the original (when packaging we set this to 'production')
|
||||
target: 'node', // extensions run in a node context
|
||||
resolve: {
|
||||
mainFields: ['main'], // prefer the main-entry of package.json files
|
||||
extensions: [".js"]
|
||||
extensions: ['.ts', '.js'] // support ts-files and js-files
|
||||
},
|
||||
module: {
|
||||
rules: []
|
||||
rules: [{
|
||||
test: /\.ts$/,
|
||||
exclude: /node_modules/,
|
||||
use: [{
|
||||
// vscode-nls-dev loader:
|
||||
// * rewrite nls-calls
|
||||
loader: 'vscode-nls-dev/lib/webpack-loader'
|
||||
}, {
|
||||
// configure TypeScript loader:
|
||||
// * only transpile because we have a separate compilation pipeline
|
||||
// * enable sources maps for end-to-end source maps
|
||||
loader: 'ts-loader',
|
||||
options: {
|
||||
transpileOnly: true,
|
||||
compilerOptions: {
|
||||
"sourceMap": true,
|
||||
}
|
||||
}
|
||||
}]
|
||||
}]
|
||||
},
|
||||
output: {
|
||||
// all output goes into `dist`.
|
||||
@@ -34,26 +53,4 @@ module.exports = function (extensionDir, useTsLoader = true) {
|
||||
// yes, really source maps
|
||||
devtool: 'source-map'
|
||||
};
|
||||
|
||||
if (useTsLoader) {
|
||||
config.resolve.extensions = [".ts", ".js"]; // support ts-files and js-files
|
||||
config.module.rules = [{
|
||||
// configure TypeScript loader:
|
||||
// * only transpile because we have a separate compilation pipeline
|
||||
// * enable sources maps for end-to-end source maps
|
||||
test: /\.ts$/,
|
||||
exclude: /node_modules/,
|
||||
use: [{
|
||||
loader: 'ts-loader',
|
||||
options: {
|
||||
transpileOnly: true,
|
||||
compilerOptions: {
|
||||
"sourceMap": true,
|
||||
}
|
||||
}
|
||||
}]
|
||||
}];
|
||||
}
|
||||
|
||||
return config;
|
||||
};
|
||||
|
||||
@@ -125,7 +125,7 @@
|
||||
"vinyl": "^0.4.5",
|
||||
"vinyl-fs": "^2.4.3",
|
||||
"vsce": "1.33.2",
|
||||
"vscode-nls-dev": "3.1.1",
|
||||
"vscode-nls-dev": "3.2.0",
|
||||
"webpack": "^4.16.5",
|
||||
"webpack-cli": "^3.1.0",
|
||||
"webpack-stream": "^5.1.1"
|
||||
|
||||
@@ -7880,9 +7880,9 @@ vscode-fsevents@0.3.8:
|
||||
dependencies:
|
||||
nan "^2.3.0"
|
||||
|
||||
vscode-nls-dev@3.1.1:
|
||||
version "3.1.1"
|
||||
resolved "https://registry.yarnpkg.com/vscode-nls-dev/-/vscode-nls-dev-3.1.1.tgz#e7fa2e8e641b1579b25779acfda0e5f7c28f1fb9"
|
||||
vscode-nls-dev@3.2.0:
|
||||
version "3.2.0"
|
||||
resolved "https://registry.yarnpkg.com/vscode-nls-dev/-/vscode-nls-dev-3.2.0.tgz#c4fe3977393b2785b82a7f0ccb2e47fd547c8657"
|
||||
dependencies:
|
||||
clone "^2.1.1"
|
||||
event-stream "^3.3.4"
|
||||
|
||||
Reference in New Issue
Block a user