-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.main.js
38 lines (36 loc) · 900 Bytes
/
webpack.main.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
//const webpack = require('webpack');
const path = require('path');
let _mode = 'production';
// create bundle for fotorama
module.exports = [
{
target: ['web','es2017'],
//entry: ['./js/fm_main.js'],
entry: {
main: './js/fm_main.js',
main_func: './js/fm_main_func.js'
},
output: {
filename: 'fm_[name].js',
chunkFilename: 'fm_[name].js',
path: path.resolve(__dirname, 'build/fm_bundle'),
},
mode: _mode,
module: {
rules: [
{
test: /\.css$/i,
use: ['style-loader', 'css-loader'],
},
{
test: /\.(png|svg|jpg|jpeg|gif)$/i,
type: 'asset/resource', // see: https://stackoverflow.com/questions/67186653/webpack-loads-wrong-images-to-dist-directory
},
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/,
},
],
},
}];