-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
41 lines (39 loc) · 859 Bytes
/
webpack.config.js
File metadata and controls
41 lines (39 loc) · 859 Bytes
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
import { join, dirname } from 'path'
import { fileURLToPath } from 'url'
const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
const include = join(__dirname, 'src')
export default {
entry: './src/index.umd.js',
output: {
path: join(__dirname, 'dist'),
library: {
name: 'transformers',
type: 'umd',
export: 'default',
},
globalObject: 'this',
},
devtool: 'source-map',
module: {
rules: [
{
test: /\.js$/,
use: 'babel-loader',
include,
exclude: /node_modules/,
},
],
},
resolve: {
extensions: ['.js', '.json'],
},
externals: {
'unique-random-array': {
commonjs: 'unique-random-array',
commonjs2: 'unique-random-array',
amd: 'unique-random-array',
root: 'uniqueRandomArray',
},
},
}