diff --git a/src/Squidex/app-config/webpack.config.js b/src/Squidex/app-config/webpack.config.js index b5e9422bb..dc81dd19a 100644 --- a/src/Squidex/app-config/webpack.config.js +++ b/src/Squidex/app-config/webpack.config.js @@ -11,13 +11,13 @@ module.exports = { /** * Options affecting the resolving of modules. * - * See: http://webpack.github.io/docs/configuration.html#resolve + * See: https://webpack.js.org/configuration/resolve/ */ resolve: { /** * An array of extensions that should be used to resolve modules. * - * See: http://webpack.github.io/docs/configuration.html#resolve-extensions + * See: https://webpack.js.org/configuration/resolve/#resolve-extensions */ extensions: ['.js', '.ts', '.css', '.scss'], modules: [ @@ -31,16 +31,13 @@ module.exports = { /* * Options affecting the normal modules. * - * See: http://webpack.github.io/docs/configuration.html#module + * See: https://webpack.js.org/configuration/module/ */ module: { /** - * An array of automatically applied loaders. + * An array of Rules which are matched to requests when modules are created. * - * IMPORTANT: The loaders here are resolved relative to the resource which they are applied to. - * This means they are not resolved relative to the configuration file. - * - * See: http://webpack.github.io/docs/configuration.html#module-loaders + * See: https://webpack.js.org/configuration/module/#module-rules */ rules: [ { @@ -71,9 +68,12 @@ module.exports = { }] }, { test: /\.css$/, - use: ExtractTextPlugin.extract({ - fallbackLoader: 'style-loader', loader: 'css-loader?sourceMap' - }) + /* + * Extract the content from a bundle to a file + * + * See: https://github.com/webpack-contrib/extract-text-webpack-plugin + */ + use: ExtractTextPlugin.extract({ fallbackLoader: 'style-loader', loader: 'css-loader?sourceMap' }) }, { test: /\.scss$/, use: [{ @@ -121,7 +121,7 @@ module.exports = { /** * Shim additional libraries * - * See: https://webpack.github.io/docs/shimming-modules.html + * See: https://webpack.js.org/plugins/provide-plugin/ */ new webpack.ProvidePlugin({ // Mouse trap handles shortcut management diff --git a/src/Squidex/app-config/webpack.run.base.js b/src/Squidex/app-config/webpack.run.base.js index 5692775fa..d59ffd867 100644 --- a/src/Squidex/app-config/webpack.run.base.js +++ b/src/Squidex/app-config/webpack.run.base.js @@ -12,7 +12,7 @@ module.exports = webpackMerge(commonConfig, { * The entry point for the bundle * Our Angular.js app * - * See: http://webpack.github.io/docs/configuration.html#entry + * See: https://webpack.js.org/configuration/entry-context/ */ entry: { 'polyfills': './app/polyfills.ts', @@ -23,9 +23,8 @@ module.exports = webpackMerge(commonConfig, { plugins: [ /** * Shares common code between the pages. - * It identifies common modules and put them into a commons chunk. * - * See: https://webpack.github.io/docs/list-of-plugins.html#commonschunkplugin + * See: https://webpack.js.org/plugins/commons-chunk-plugin/ */ new webpack.optimize.CommonsChunkPlugin({ name: ['app', 'vendor', 'polyfills'] diff --git a/src/Squidex/app-config/webpack.run.dev.js b/src/Squidex/app-config/webpack.run.dev.js index 06ff4dfa0..c75060200 100644 --- a/src/Squidex/app-config/webpack.run.dev.js +++ b/src/Squidex/app-config/webpack.run.dev.js @@ -10,8 +10,8 @@ module.exports = webpackMerge(runConfig, { /** * Developer tool to enhance debugging * - * See: http://webpack.github.io/docs/configuration.html#devtool - * See: https://github.com/webpack/docs/wiki/build-performance#sourcemaps + * See: https://webpack.js.org/configuration/devtool/#devtool + * See: https://webpack.js.org/guides/build-performance/ */ devtool: 'cheap-module-source-map', @@ -26,16 +26,13 @@ module.exports = webpackMerge(runConfig, { /* * Options affecting the normal modules. * - * See: http://webpack.github.io/docs/configuration.html#module + * See: https://webpack.js.org/configuration/module/ */ module: { /** - * An array of automatically applied loaders. + * An array of Rules which are matched to requests when modules are created. * - * IMPORTANT: The loaders here are resolved relative to the resource which they are applied to. - * This means they are not resolved relative to the configuration file. - * - * See: http://webpack.github.io/docs/configuration.html#module-loaders + * See: https://webpack.js.org/configuration/module/#module-rules */ rules: [ { diff --git a/src/Squidex/app-config/webpack.run.prod.js b/src/Squidex/app-config/webpack.run.prod.js index b2b353979..ee31e3265 100644 --- a/src/Squidex/app-config/webpack.run.prod.js +++ b/src/Squidex/app-config/webpack.run.prod.js @@ -16,7 +16,7 @@ module.exports = webpackMerge(runConfig, { /** * The output directory as absolute path (required). * - * See: http://webpack.github.io/docs/configuration.html#output-path + * See: https://webpack.js.org/configuration/output/#output-path */ path: helpers.root('wwwroot/build/'), @@ -26,7 +26,7 @@ module.exports = webpackMerge(runConfig, { * Specifies the name of each output file on disk. * IMPORTANT: You must not specify an absolute path here! * - * See: http://webpack.github.io/docs/configuration.html#output-filename + * See: https://webpack.js.org/configuration/output/#output-filename */ filename: '[name].[hash].js', @@ -34,7 +34,7 @@ module.exports = webpackMerge(runConfig, { * The filename of non-entry chunks as relative path * inside the output.path directory. * - * See: http://webpack.github.io/docs/configuration.html#output-chunkfilename + * See: https://webpack.js.org/configuration/output/#output-chunkfilename */ chunkFilename: '[id].[hash].chunk.js' }, @@ -42,23 +42,26 @@ module.exports = webpackMerge(runConfig, { /* * Options affecting the normal modules. * - * See: http://webpack.github.io/docs/configuration.html#module + * See: https://webpack.js.org/configuration/module/ */ module: { /** - * An array of automatically applied loaders. + * An array of Rules which are matched to requests when modules are created. * - * IMPORTANT: The loaders here are resolved relative to the resource which they are applied to. - * This means they are not resolved relative to the configuration file. - * - * See: http://webpack.github.io/docs/configuration.html#module-loaders + * See: https://webpack.js.org/configuration/module/#module-rules */ rules: [ { test: /\.scss$/, - use: ExtractTextPlugin.extract({ - fallbackLoader: 'style-loader', loader: 'css-loader!sass-loader?sourceMap' - }), + /* + * Extract the content from a bundle to a file + * + * See: https://github.com/webpack-contrib/extract-text-webpack-plugin + */ + use: ExtractTextPlugin.extract({ fallbackLoader: 'style-loader', loader: 'css-loader!sass-loader?sourceMap' }), + /* + * Do not include component styles + */ include: helpers.root('app', 'theme'), }, { test: /\.scss$/, diff --git a/src/Squidex/app-config/webpack.test.coverage.js b/src/Squidex/app-config/webpack.test.coverage.js index 9b5a60f49..4bfdb9654 100644 --- a/src/Squidex/app-config/webpack.test.coverage.js +++ b/src/Squidex/app-config/webpack.test.coverage.js @@ -4,12 +4,15 @@ var webpackMerge = require('webpack-merge'), helpers = require('./helpers'), testConfig = require('./webpack.test.js'); - // console.log(JSON.stringify(testConfig, null, '\t')); - helpers.removeLoaders(testConfig, ['ts']); module.exports = webpackMerge(testConfig, { - module: { + module: { + /** + * An array of Rules which are matched to requests when modules are created. + * + * See: https://webpack.js.org/configuration/module/#module-rules + */ rules: [ { test: /\.ts$/, diff --git a/src/Squidex/app-config/webpack.test.js b/src/Squidex/app-config/webpack.test.js index eec3bbfa2..04955323e 100644 --- a/src/Squidex/app-config/webpack.test.js +++ b/src/Squidex/app-config/webpack.test.js @@ -8,7 +8,7 @@ module.exports = webpackMerge(commonConfig, { * Source map for Karma from the help of karma-sourcemap-loader & karma-webpack * * Do not change, leave as is or it wont work. - * See: https://github.com/webpack/karma-webpack#source-maps + * See: https://webpack.js.org/configuration/devtool/ */ devtool: 'inline-source-map', }); \ No newline at end of file