forked from iTwin/viewer-components-react
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
56 lines (52 loc) · 1.55 KB
/
webpack.config.js
File metadata and controls
56 lines (52 loc) · 1.55 KB
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
/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
const path = require("path");
const glob = require("glob");
const libFolder = path.resolve(__dirname, "lib/cjs");
module.exports = {
mode: "development",
entry: glob.sync(path.resolve(libFolder, "test/**/*.test.js")),
output: {
path: path.resolve(libFolder, "test/webpack"),
filename: "bundled-tests.js",
devtoolModuleFilenameTemplate: "file:///[absolute-resource-path]"
},
devtool: "nosources-source-map",
module: {
noParse: [
// Don't parse draco_*_nodejs.js modules for `require` calls. There are
// requires for fs that cause it to fail even though the fs dependency
// is not used.
/draco_decoder_nodejs.js$/,
/draco_encoder_nodejs.js$/
],
rules: [
{
test: /\.js$/,
use: "source-map-loader",
enforce: "pre"
},
{
test: /azure-storage|AzureFileHandler|UrlFileHandler|dotenv/,
use: "null-loader"
},
{
test: /\.(css|scss)$/,
use: "null-loader"
},
{
test: /\.(png|woff|woff2|eot|ttf|svg)$/,
use: "url-loader"
}
]
},
stats: "errors-only",
optimization: {
nodeEnv: "production"
},
externals: {
electron: "commonjs electron",
},
};