|
1 | | -var path = require('path'); |
| 1 | +var path = require('path'); |
2 | 2 | var webpack = require('webpack'); |
3 | | -var pkg = require('./package.json'); |
4 | | - |
5 | | -var banner = "/*\n" + |
6 | | - " * " + pkg.name + " - v" + pkg.version + "\n" + |
7 | | - " * " + pkg.description + "\n" + |
8 | | - " * " + pkg.homepage + "\n" + |
9 | | - " *\n" + |
10 | | - " * Made by " + pkg.author.name + "\n" + |
11 | | - " * Under " + pkg.license + " License\n" + |
12 | | - " */\n"; |
| 3 | +var pkg = require('./package.json'); |
13 | 4 |
|
14 | 5 | module.exports = { |
15 | | - entry : './src/embed.es6', |
16 | | - output : { |
17 | | - path : path.join(__dirname, 'dist'), |
18 | | - filename: 'embed.js' |
19 | | - }, |
20 | | - module : { |
21 | | - preLoaders: [ |
22 | | - { |
23 | | - test : /\.es6$/, |
24 | | - exclude: /node_modules/, |
25 | | - loader : 'jshint-loader' |
26 | | - } |
27 | | - ], |
28 | | - loaders : [ |
29 | | - { |
30 | | - test : /\.es6$/, |
31 | | - exclude: /node_modules/, |
32 | | - loader : 'babel-loader' |
33 | | - } |
34 | | - ] |
35 | | - }, |
36 | | - plugins: [ |
37 | | - // Avoid publishing files when compilation failed |
38 | | - new webpack.NoErrorsPlugin(), |
39 | | - new webpack.ProvidePlugin({ |
40 | | - 'fetch': 'imports?this=>global!exports?global.fetch!whatwg-fetch' |
41 | | - }), |
42 | | - |
43 | | - new webpack.optimize.UglifyJsPlugin({ |
44 | | - compress: { |
45 | | - drop_console: true |
46 | | - } |
47 | | - }), |
48 | | - new webpack.BannerPlugin(banner, { |
49 | | - raw: true |
50 | | - }) |
51 | | - ], |
52 | | - stats : { |
53 | | - // Nice colored output |
54 | | - colors: true |
55 | | - }, |
56 | | - devtool: 'source-map' |
| 6 | + entry: './src/embed.es6', |
| 7 | + output: { |
| 8 | + path: path.join(__dirname, 'dist'), |
| 9 | + filename: 'embed.js', |
| 10 | + publicPath: 'dist/' |
| 11 | + }, |
| 12 | + module: { |
| 13 | + preLoaders: [{ |
| 14 | + test: /\.es6$/, |
| 15 | + exclude: /node_modules/, |
| 16 | + loader: 'jshint-loader' |
| 17 | + }], |
| 18 | + loaders: [{ |
| 19 | + test: /\.es6$/, |
| 20 | + exclude: /node_modules/, |
| 21 | + loader: 'babel-loader' |
| 22 | + }] |
| 23 | + }, |
| 24 | + plugins: [ |
| 25 | + // Avoid publishing files when compilation failed |
| 26 | + new webpack.NoErrorsPlugin(), |
| 27 | + new webpack.ProvidePlugin({ |
| 28 | + 'fetch': 'imports?this=>global!exports?global.fetch!whatwg-fetch' |
| 29 | + }) |
| 30 | + ], |
| 31 | + stats: { |
| 32 | + // Nice colored output |
| 33 | + colors: true |
| 34 | + } |
57 | 35 | }; |
0 commit comments