forked from x-orpheus/react-monaco-editor-lite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.build.js
60 lines (59 loc) · 1.34 KB
/
webpack.build.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
// @ts-nocheck
/* eslint-disable */
const path = require('path');
const webpack = require('webpack');
// const HtmlWebpackPlugin = require("html-webpack-plugin");
module.exports = {
entry: {
index: './src/index.ts',
},
output: {
path: path.join(__dirname, 'dist'),
filename: '[name].bundle.js',
libraryTarget: 'umd',
},
mode: 'development',
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: ['babel-loader'],
},
{
test: /\.(ts|tsx)$/,
exclude: /node_modules/,
use: ['ts-loader'],
},
{
test: /\.(css|less)$/,
use: ['style-loader', 'css-loader', 'less-loader'],
},
{
test: /\.(jpg|jpeg|png|gif|mp3|svg|ttf)$/,
use: ['file-loader'],
},
],
},
plugins: [
new webpack.ProvidePlugin({
process: 'process/browser',
}),
new webpack.DefinePlugin({
_ASSETSPATH: JSON.stringify(
'https://s5.music.126.net/static_public/6194df158463e8444a55b9d8_6194df158463e8444a55b9da/'
),
}),
],
resolve: {
extensions: ['.tsx', '.ts', '.js'],
alias: {
'@components': path.resolve(__dirname, './src/components'),
'@utils': path.resolve(__dirname, './src/utils'),
},
},
externals: {
react: 'react',
'react-dom': 'react-dom',
},
};