extension.webpack.config.js 1.2 KB
Newer Older
M
Martin Aeschlimann 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/

//@ts-check

'use strict';

const withDefaults = require('../../shared.webpack.config');
const path = require('path');
var webpack = require('webpack');

module.exports = withDefaults({
	context: path.join(__dirname),
	entry: {
		extension: './src/htmlServerMain.ts',
	},
	resolve: {
		mainFields: ['module', 'main'],
		extensions: ['.ts', '.js'] // support ts-files and js-files
	},
	node: {
		__dirname: false // leave the __dirname-behaviour intact
	},
	output: {
		filename: 'htmlServerMain.js',
		path: path.join(__dirname, 'dist'),
		libraryTarget: "commonjs",
	},
	externals: {
		'typescript': 'commonjs typescript',
		"vscode-nls": 'commonjs vscode-nls',
	},
	plugins: [
		new webpack.NormalModuleReplacementPlugin(
37
			/\/|\\vscode-languageserver\/|\\lib\/|\\files\.js/,
M
Martin Aeschlimann 已提交
38 39 40 41 42
			require.resolve('./build/filesFillIn')
		),
		new webpack.IgnorePlugin(/vertx/)
	],
});