Browse Source

use webpack 2.

oldj 8 years ago
parent
commit
70dc3eca0e
3 changed files with 18944 additions and 14531 deletions
  1. 18932 14519
      app/build/bundle.js
  2. 2 2
      package.json
  3. 10 10
      webpack.config.js

File diff suppressed because it is too large
+ 18932 - 14519
app/build/bundle.js


+ 2 - 2
package.json

@@ -41,7 +41,7 @@
     "style-loader": "^0.13.1",
     "uglify-loader": "^1.4.0",
     "url-loader": "^0.5.7",
-    "webpack": "^1.14.0",
+    "webpack": "^2.2.1",
     "yargs": "^6.5.0"
   }
-}
+}

+ 10 - 10
webpack.config.js

@@ -7,7 +7,7 @@
 
 const path = require('path');
 const webpack = require('webpack');
-const uglifyJsPlugin = webpack.optimize.UglifyJsPlugin;
+// const uglifyJsPlugin = webpack.optimize.UglifyJsPlugin;
 
 module.exports = {
     entry: './app/src/ui.js',
@@ -17,24 +17,23 @@ module.exports = {
         filename: 'bundle.js'
     },
     resolve: {
-        extensions: ['', '.js', '.jsx']
+        extensions: ['.js', '.jsx']
     },
     module: {
-        loaders: [
+        rules: [
             {
                 test: /\.jsx?$/,
                 exclude: /node_modules/,
-                loaders: ['babel?presets[]=react,presets[]=latest']
+                use: ['babel-loader?presets[]=react,presets[]=latest']
             }, {
                 test: /\.less$/,
-                loaders: ['style', 'css', 'less']
+                use: ['style-loader', 'css-loader', 'less-loader']
             }, {
                 test: /\.css$/,
-                loaders: ['style', 'css']
-            },
-            {
+                use: ['style-loader', 'css-loader']
+            }, {
                 test: /\.(eot|woff|woff2|ttf|svg|png|jpg)$/,
-                loader: 'url-loader?limit=30000&name=[name]-[hash].[ext]'
+                use: 'url-loader?limit=30000&name=[name]-[hash].[ext]'
             }
         ]//,
         // query: {
@@ -43,8 +42,9 @@ module.exports = {
     },
     plugins: [
         // new uglifyJsPlugin({
+        //     sourceMap: true,
         //     compress: {
-        //         warnings: false
+        //         warnings: true
         //     }
         // })
     ]

Some files were not shown because too many files changed in this diff