]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/config/webpack.dev.js
Share models between server and client
[github/Chocobozzz/PeerTube.git] / client / config / webpack.dev.js
index affb20f1904587cc1c1527f18ebe03248783a27a..c472ac762f6e0f48462431645bba7cb13fa9a328 100644 (file)
@@ -22,7 +22,8 @@ const METADATA = webpackMerge(commonConfig({env: ENV}).metadata, {
   host: HOST,
   port: PORT,
   ENV: ENV,
-  HMR: HMR
+  HMR: HMR,
+  API_URL: 'http://localhost:9000'
 })
 
 const DllBundlesPlugin = require('webpack-dll-bundles-plugin').DllBundlesPlugin
@@ -79,13 +80,29 @@ module.exports = function (env) {
       chunkFilename: '[id].chunk.js',
 
       library: 'ac_[name]',
-      libraryTarget: 'var',
-
-      publicPath: '/client/'
+      libraryTarget: 'var'
     },
 
-    externals: {
-      webtorrent: 'WebTorrent'
+    module: {
+
+      // Too slow, life is short
+      // rules: [
+      //   {
+      //     test: /\.ts$/,
+      //     use: [
+      //       {
+      //         loader: 'tslint-loader',
+      //         options: {
+      //           configFile: 'tslint.json'
+      //         }
+      //       }
+      //     ],
+      //     exclude: [
+      //       /\.(spec|e2e)\.ts$/,
+      //       /node_modules\//
+      //     ]
+      //   }
+      // ]
     },
 
     plugins: [
@@ -103,6 +120,8 @@ module.exports = function (env) {
       new DefinePlugin({
         'ENV': JSON.stringify(METADATA.ENV),
         'HMR': METADATA.HMR,
+        'API_URL': JSON.stringify(METADATA.API_URL),
+        'process.version': JSON.stringify(process.version),
         'process.env': {
           'ENV': JSON.stringify(METADATA.ENV),
           'NODE_ENV': JSON.stringify(METADATA.ENV),
@@ -121,8 +140,7 @@ module.exports = function (env) {
             {
               name: 'zone.js',
               path: 'zone.js/dist/long-stack-trace-zone.js'
-            },
-            'ts-helpers'
+            }
           ],
           vendor: [
             '@angular/platform-browser',
@@ -182,6 +200,7 @@ module.exports = function (env) {
           tslint: {
             emitErrors: false,
             failOnHint: false,
+            typeCheck: true,
             resourcePath: 'src'
           },
 
@@ -211,10 +230,8 @@ module.exports = function (env) {
       host: METADATA.host,
       historyApiFallback: true,
       watchOptions: {
-        aggregateTimeout: 300,
-        poll: 1000
-      },
-      outputPath: helpers.root('dist')
+        ignored: /node_modules/
+      }
     },
 
     /*
@@ -226,6 +243,7 @@ module.exports = function (env) {
     node: {
       global: true,
       crypto: 'empty',
+      fs: 'empty',
       process: true,
       module: false,
       clearImmediate: false,