forked from Choices-js/Choices
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.base.js
More file actions
46 lines (44 loc) · 881 Bytes
/
webpack.config.base.js
File metadata and controls
46 lines (44 loc) · 881 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
42
43
44
45
46
const ESLintPlugin = require('eslint-webpack-plugin');
const path = require('path');
const include = path.resolve(__dirname, './src/scripts');
const exclude = /node_modules/;
/**
* @type {import('webpack').Configuration}
*/
module.exports = {
entry: ['./src/index'],
module: {
rules: [
{
loader: 'babel-loader',
test: /\.ts?$/,
include,
exclude,
options: {
babelrc: true,
},
},
{
loader: 'ts-loader',
test: /\.ts?$/,
include,
exclude
}
],
},
resolve: {
extensions: [".ts", ".js"]
},
plugins: [new ESLintPlugin({
context: include,
files: '**/*.js',
exclude: 'node_modules',
quiet: true
})],
output: {
library: 'Choices',
libraryTarget: 'window',
libraryExport: 'default',
globalObject: 'window',
},
};