-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.common.js
executable file
·97 lines (89 loc) · 2.69 KB
/
webpack.common.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
const path = require('path');
const glob = require("glob");
const webpack = require('webpack');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const package = require('./package.json');
/*
TODO: Support for integrity and crossorigin
https://www.srihash.org
<script
src="https://code.jquery.com/jquery-3.3.1.js"
integrity="sha256-2Kok7MbOyxpgUVvAk/HJ2jigOSYS2auK4Pfzbm7uH60="
crossorigin="anonymous"></script>
*/
var banner =
package.name + '\n' +
'version ' + package.version + '\n' +
'------------------------------------ ' + '\n' +
package.description + '\n' +
'------------------------------------ ' + '\n' +
'' + '\n' +
'Rassvet ApS, https://rassvet.co' + '\n' +
'Public domain.' + '\n' +
'NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.';
module.exports = {
entry: [
// Theme files
'./themes/businesslogic-standard-theme.scss',
//'./themes/businesslogic-elegant-theme.scss',
// Main files
'./src/index.ts'
],
//devtool: 'inline-source-map',
module: {
rules: [
{
test: /\.tsx?$/,
use: [
{ loader: 'babel-loader'},
{ loader: 'strip-whitespace-loader' },
{ loader: 'ts-loader' }
],
exclude: /node_modules/
},
{
test: /\.scss$/,
use: [
{
loader: 'file-loader',
options: {
name: '[name].css'
}
},
{
loader: 'extract-loader'
},
{
loader: 'css-loader',
options: {
minimize: true,
//sourceMap: true,
importLoaders: 2
}
},
{
loader: 'postcss-loader'
},
{
loader: 'sass-loader'
}
],
exclude: /node_modules/
}
]
},
plugins: [
new webpack.BannerPlugin(banner)
],
resolve: {
extensions: [ '.tsx', '.ts', '.js', '.scss', '.css' ]
},
output: {
path: path.resolve(__dirname, 'lib'),
filename: package.name + '.' + package.version + '.js',
library: 'Businesslogic',
libraryTarget: 'umd',
umdNamedDefine: true
}
};