]>
git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/config/webpack.dev.js
19768d872376afc8aa642dc5a1ccf86a7b5f37c8
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')
13 const ENV
= process
.env
.ENV
= process
.env
.NODE_ENV
= 'development'
14 const HMR
= helpers
.hasProcessFlag('hot')
15 const METADATA
= webpackMerge(commonConfig
.metadata
, {
23 * Webpack configuration
25 * See: http://webpack.github.io/docs/configuration.html#cli
27 module
.exports
= webpackMerge(commonConfig
, {
29 * Merged metadata from webpack.common.js for index.html
31 * See: (custom attribute)
36 * Switch loaders to debug mode.
38 * See: http://webpack.github.io/docs/configuration.html#debug
43 * Developer tool to enhance debugging
45 * See: http://webpack.github.io/docs/configuration.html#devtool
46 * See: https://github.com/webpack/docs/wiki/build-performance#sourcemaps
48 devtool: 'cheap-module-source-map',
51 * Options affecting the output of the compilation.
53 * See: http://webpack.github.io/docs/configuration.html#output
57 * The output directory as absolute path (required).
59 * See: http://webpack.github.io/docs/configuration.html#output-path
61 path: helpers
.root('dist'),
64 * Specifies the name of each output file on disk.
65 * IMPORTANT: You must not specify an absolute path here!
67 * See: http://webpack.github.io/docs/configuration.html#output-filename
69 filename: '[name].bundle.js',
72 * The filename of the SourceMaps for the JavaScript files.
73 * They are inside the output.path directory.
75 * See: http://webpack.github.io/docs/configuration.html#output-sourcemapfilename
77 sourceMapFilename: '[name].map',
79 /** The filename of non-entry chunks as relative path
80 * inside the output.path directory.
82 * See: http://webpack.github.io/docs/configuration.html#output-chunkfilename
84 chunkFilename: '[id].chunk.js',
86 publicPath: '/client/'
93 * Plugin: DefinePlugin
94 * Description: Define free variables.
95 * Useful for having development builds with debug logging or adding global constants.
99 * See: https://webpack.github.io/docs/list-of-plugins.html#defineplugin
101 // NOTE: when adding more properties, make sure you include them in custom-typings.d.ts
103 'ENV': JSON
.stringify(METADATA
.ENV
),
106 'ENV': JSON
.stringify(METADATA
.ENV
),
107 'NODE_ENV': JSON
.stringify(METADATA
.ENV
),
114 * Static analysis linter for TypeScript advanced options configuration
115 * Description: An extensible linter for the TypeScript language.
117 * See: https://github.com/wbuchwalter/tslint-loader
126 * Webpack Development Server configuration
127 * Description: The webpack-dev-server is a little node.js Express server.
128 * The server emits information about the compilation state to the client,
129 * which reacts to those events.
131 * See: https://webpack.github.io/docs/webpack-dev-server.html
136 historyApiFallback: true,
138 aggregateTimeout: 300,
141 outputPath: helpers
.root('dist')
145 * Include polyfills or mocks for various node stuff
146 * Description: Node configuration
148 * See: https://webpack.github.io/docs/configuration.html#node
155 clearImmediate: false,