1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 | 'use strict';
|
16 |
|
17 | let path = require('path');
|
18 | const webpack = require('webpack');
|
19 | const packageJson = require('./package.json');
|
20 |
|
21 | module.exports = {
|
22 | entry: {
|
23 | client: [
|
24 | './index.js'
|
25 | ]
|
26 | },
|
27 | output: {
|
28 | path: path.join(__dirname, 'umd'),
|
29 | filename: 'concerto.js',
|
30 | library: {
|
31 | name: 'concerto',
|
32 | type: 'umd',
|
33 | },
|
34 | umdNamedDefine: true,
|
35 | },
|
36 | plugins: [
|
37 | new webpack.BannerPlugin(`Concerto v${packageJson.version}
|
38 | Licensed under the Apache License, Version 2.0 (the "License");
|
39 | you may not use this file except in compliance with the License.
|
40 | You may obtain a copy of the License at
|
41 | http://www.apache.org/licenses/LICENSE-2.0
|
42 | Unless required by applicable law or agreed to in writing, software
|
43 | distributed under the License is distributed on an "AS IS" BASIS,
|
44 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
45 | See the License for the specific language governing permissions and
|
46 | limitations under the License.`),
|
47 | new webpack.DefinePlugin({
|
48 | 'process.env': {
|
49 | 'NODE_ENV': JSON.stringify('production')
|
50 | }
|
51 | }),
|
52 | ],
|
53 | module: {
|
54 | rules: [
|
55 | {
|
56 | test: /\.js$/,
|
57 | include: [path.join(__dirname, 'lib')],
|
58 | use: ['babel-loader']
|
59 | },
|
60 | {
|
61 | test: /\.ne$/,
|
62 | use:['raw-loader']
|
63 | }
|
64 | ]
|
65 | },
|
66 | resolve: {
|
67 | fallback: {
|
68 | 'fs': false,
|
69 | 'tls': false,
|
70 | 'net': false,
|
71 | 'path': false,
|
72 | 'os': false,
|
73 | 'util': false,
|
74 | 'url': false,
|
75 | }
|
76 | }
|
77 | }; |
\ | No newline at end of file |