]>
git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/config/webpack.dev.js
1 const helpers
= require('./helpers')
2 const webpackMerge
= require('webpack-merge') // used to merge webpack configs
3 const commonConfig
= require('./webpack.common.js') // the settings that are common to prod and dev
8 const DefinePlugin
= require('webpack/lib/DefinePlugin')
9 const NamedModulesPlugin
= require('webpack/lib/NamedModulesPlugin')
14 const ENV
= process
.env
.ENV
= process
.env
.NODE_ENV
= 'development'
15 const HOST
= process
.env
.HOST
|| 'localhost'
16 const PORT
= process
.env
.PORT
|| 3000
17 const HMR
= helpers
.hasProcessFlag('hot')
18 const METADATA
= webpackMerge(commonConfig({env: ENV
}).metadata
, {
26 * Webpack configuration
28 * See: http://webpack.github.io/docs/configuration.html#cli
30 module
.exports = function (env
) {
31 return webpackMerge(commonConfig({env: ENV
}), {
33 * Merged metadata from webpack.common.js for index.html
35 * See: (custom attribute)
40 * Switch loaders to debug mode.
42 * See: http://webpack.github.io/docs/configuration.html#debug
47 * Developer tool to enhance debugging
49 * See: http://webpack.github.io/docs/configuration.html#devtool
50 * See: https://github.com/webpack/docs/wiki/build-performance#sourcemaps
52 devtool: 'cheap-module-source-map',
55 * Options affecting the output of the compilation.
57 * See: http://webpack.github.io/docs/configuration.html#output
61 * The output directory as absolute path (required).
63 * See: http://webpack.github.io/docs/configuration.html#output-path
65 path: helpers
.root('dist'),
68 * Specifies the name of each output file on disk.
69 * IMPORTANT: You must not specify an absolute path here!
71 * See: http://webpack.github.io/docs/configuration.html#output-filename
73 filename: '[name].bundle.js',
76 * The filename of the SourceMaps for the JavaScript files.
77 * They are inside the output.path directory.
79 * See: http://webpack.github.io/docs/configuration.html#output-sourcemapfilename
81 sourceMapFilename: '[name].map',
83 /** The filename of non-entry chunks as relative path
84 * inside the output.path directory.
86 * See: http://webpack.github.io/docs/configuration.html#output-chunkfilename
88 chunkFilename: '[id].chunk.js',
96 webtorrent: 'WebTorrent'
102 * Plugin: DefinePlugin
103 * Description: Define free variables.
104 * Useful for having development builds with debug logging or adding global constants.
106 * Environment helpers
108 * See: https://webpack.github.io/docs/list-of-plugins.html#defineplugin
110 // NOTE: when adding more properties, make sure you include them in custom-typings.d.ts
112 'ENV': JSON
.stringify(METADATA
.ENV
),
115 'ENV': JSON
.stringify(METADATA
.ENV
),
116 'NODE_ENV': JSON
.stringify(METADATA
.ENV
),
121 new NamedModulesPlugin()
125 * Static analysis linter for TypeScript advanced options configuration
126 * Description: An extensible linter for the TypeScript language.
128 * See: https://github.com/wbuchwalter/tslint-loader
139 historyApiFallback: true,
141 aggregateTimeout: 300,
144 outputPath: helpers
.root('dist')
148 * Include polyfills or mocks for various node stuff
149 * Description: Node configuration
151 * See: https://webpack.github.io/docs/configuration.html#node
158 clearImmediate: false,