-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwebpack.base.js
55 lines (45 loc) · 1.6 KB
/
webpack.base.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
const path = require('path');
const CopyWebpackPlugin = require('copy-webpack-plugin');
//const bundleAnalyzer = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
module.exports = {
entry: './src/MainComponent.tsx',
output: {
filename: "app.js",
path: __dirname + "/dist/scripts",
libraryTarget: "amd"
},
externals: [
{
'react': true,
'react-dom': true,
'q': true
},
/^TFS\//, // Ignore TFS/* since they are coming from VSTS host
/^VSS\// // Ignore VSS/* since they are coming from VSTS host
],
resolve: {
alias:
{
"OfficeFabric": path.join(__dirname, "./node_modules/office-ui-fabric-react/lib-amd")
},
// Add '.ts' and '.tsx' as resolvable extensions.
extensions: [".ts", ".tsx", ".js", ".json"]
},
module: {
rules: [
// All files with a '.ts' or '.tsx' extension will be handled by 'ts-loader'.
{ test: /\.tsx?$/, loader: "ts-loader" },
// All output '.js' files will have any sourcemaps re-processed by 'source-map-loader'.
{ enforce: "pre", test: /\.js$/, loader: "source-map-loader" }
]
},
plugins: [
new CopyWebpackPlugin([
{ from: 'css/', to: 'css/' },
{ from: 'node_modules/office-ui-fabric-react/dist/css/fabric.min.css', to: 'css/'},
{ from: 'node_modules/vss-web-extension-sdk/lib/VSS.SDK.min.js'}
])
],
//plugins: [new bundleAnalyzer({analyzerMode : 'static'})],
devtool: 'source-map'
};