-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack.config.js
97 lines (95 loc) · 2.2 KB
/
webpack.config.js
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT license.
* @see https://github.com/microsoft/vscode-java-pack/blob/master/webpack.config.js
*/
const webpack = require('webpack');
const path = require('path');
module.exports = function (env, argv) {
env = env || {};
return [{
name: 'assets',
mode: 'none',
entry: {
overview: './src/overview/assets/index.ts'
},
module: {
rules: [{
test: /\.ts(x?)$/,
exclude: /node_modules/,
use: 'ts-loader'
}, {
test: /\.(scss)$/,
use: [{
loader: 'style-loader'
}, {
loader: 'css-loader'
}, {
loader: 'postcss-loader',
options: {
postcssOptions: {
plugins: [
[
"autoprefixer",
{
// Options
},
],
],
},
// plugins: function () {
// return [require('autoprefixer')];
// }
}
}, {
loader: 'sass-loader'
}]
}]
},
output: {
filename: 'assets/[name]/index.js',
path: path.resolve(__dirname, 'out'),
publicPath: '/',
devtoolModuleFilenameTemplate: "../[resource-path]"
},
plugins: [
new webpack.ProvidePlugin({
process: 'process/browser',
})
],
devtool: 'source-map',
resolve: {
extensions: ['.js', '.ts', '.tsx']
}
}, {
name: 'extension',
target: 'node',
mode: 'none',
entry: {
extension: './src/extension.ts'
},
module: {
rules: [{
test: /\.ts$/,
exclude: /node_modules/,
use: 'ts-loader'
}]
},
resolve: {
modules: ['node_modules', path.resolve(__dirname, 'src')],
mainFiles: ['index'],
extensions: ['.js', '.ts', '.json']
},
output: {
filename: '[name].js',
path: path.resolve(__dirname, 'out'),
libraryTarget: "commonjs2",
publicPath: '/',
devtoolModuleFilenameTemplate: "../[resource-path]"
},
externals: {
vscode: 'commonjs vscode'
},
devtool: 'source-map'
}]
};