Browse Source

Docs updated

pull/1/head
Sebastian 9 years ago
parent
commit
5c0b43cb26
  1. 24
      src/Squidex/app-config/webpack.config.js
  2. 5
      src/Squidex/app-config/webpack.run.base.js
  3. 13
      src/Squidex/app-config/webpack.run.dev.js
  4. 27
      src/Squidex/app-config/webpack.run.prod.js
  5. 9
      src/Squidex/app-config/webpack.test.coverage.js
  6. 2
      src/Squidex/app-config/webpack.test.js

24
src/Squidex/app-config/webpack.config.js

@ -11,13 +11,13 @@ module.exports = {
/** /**
* Options affecting the resolving of modules. * Options affecting the resolving of modules.
* *
* See: http://webpack.github.io/docs/configuration.html#resolve * See: https://webpack.js.org/configuration/resolve/
*/ */
resolve: { resolve: {
/** /**
* An array of extensions that should be used to resolve modules. * 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'], extensions: ['.js', '.ts', '.css', '.scss'],
modules: [ modules: [
@ -31,16 +31,13 @@ module.exports = {
/* /*
* Options affecting the normal modules. * Options affecting the normal modules.
* *
* See: http://webpack.github.io/docs/configuration.html#module * See: https://webpack.js.org/configuration/module/
*/ */
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. * See: https://webpack.js.org/configuration/module/#module-rules
* This means they are not resolved relative to the configuration file.
*
* See: http://webpack.github.io/docs/configuration.html#module-loaders
*/ */
rules: [ rules: [
{ {
@ -71,9 +68,12 @@ module.exports = {
}] }]
}, { }, {
test: /\.css$/, 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$/, test: /\.scss$/,
use: [{ use: [{
@ -121,7 +121,7 @@ module.exports = {
/** /**
* Shim additional libraries * Shim additional libraries
* *
* See: https://webpack.github.io/docs/shimming-modules.html * See: https://webpack.js.org/plugins/provide-plugin/
*/ */
new webpack.ProvidePlugin({ new webpack.ProvidePlugin({
// Mouse trap handles shortcut management // Mouse trap handles shortcut management

5
src/Squidex/app-config/webpack.run.base.js

@ -12,7 +12,7 @@ module.exports = webpackMerge(commonConfig, {
* The entry point for the bundle * The entry point for the bundle
* Our Angular.js app * Our Angular.js app
* *
* See: http://webpack.github.io/docs/configuration.html#entry * See: https://webpack.js.org/configuration/entry-context/
*/ */
entry: { entry: {
'polyfills': './app/polyfills.ts', 'polyfills': './app/polyfills.ts',
@ -23,9 +23,8 @@ module.exports = webpackMerge(commonConfig, {
plugins: [ plugins: [
/** /**
* Shares common code between the pages. * 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({ new webpack.optimize.CommonsChunkPlugin({
name: ['app', 'vendor', 'polyfills'] name: ['app', 'vendor', 'polyfills']

13
src/Squidex/app-config/webpack.run.dev.js

@ -10,8 +10,8 @@ module.exports = webpackMerge(runConfig, {
/** /**
* Developer tool to enhance debugging * Developer tool to enhance debugging
* *
* See: http://webpack.github.io/docs/configuration.html#devtool * See: https://webpack.js.org/configuration/devtool/#devtool
* See: https://github.com/webpack/docs/wiki/build-performance#sourcemaps * See: https://webpack.js.org/guides/build-performance/
*/ */
devtool: 'cheap-module-source-map', devtool: 'cheap-module-source-map',
@ -26,16 +26,13 @@ module.exports = webpackMerge(runConfig, {
/* /*
* Options affecting the normal modules. * Options affecting the normal modules.
* *
* See: http://webpack.github.io/docs/configuration.html#module * See: https://webpack.js.org/configuration/module/
*/ */
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. * See: https://webpack.js.org/configuration/module/#module-rules
* This means they are not resolved relative to the configuration file.
*
* See: http://webpack.github.io/docs/configuration.html#module-loaders
*/ */
rules: [ rules: [
{ {

27
src/Squidex/app-config/webpack.run.prod.js

@ -16,7 +16,7 @@ module.exports = webpackMerge(runConfig, {
/** /**
* The output directory as absolute path (required). * 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/'), path: helpers.root('wwwroot/build/'),
@ -26,7 +26,7 @@ module.exports = webpackMerge(runConfig, {
* Specifies the name of each output file on disk. * Specifies the name of each output file on disk.
* IMPORTANT: You must not specify an absolute path here! * 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', filename: '[name].[hash].js',
@ -34,7 +34,7 @@ module.exports = webpackMerge(runConfig, {
* The filename of non-entry chunks as relative path * The filename of non-entry chunks as relative path
* inside the output.path directory. * 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' chunkFilename: '[id].[hash].chunk.js'
}, },
@ -42,23 +42,26 @@ module.exports = webpackMerge(runConfig, {
/* /*
* Options affecting the normal modules. * Options affecting the normal modules.
* *
* See: http://webpack.github.io/docs/configuration.html#module * See: https://webpack.js.org/configuration/module/
*/ */
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. * See: https://webpack.js.org/configuration/module/#module-rules
* This means they are not resolved relative to the configuration file.
*
* See: http://webpack.github.io/docs/configuration.html#module-loaders
*/ */
rules: [ rules: [
{ {
test: /\.scss$/, 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'), include: helpers.root('app', 'theme'),
}, { }, {
test: /\.scss$/, test: /\.scss$/,

9
src/Squidex/app-config/webpack.test.coverage.js

@ -4,12 +4,15 @@ var webpackMerge = require('webpack-merge'),
helpers = require('./helpers'), helpers = require('./helpers'),
testConfig = require('./webpack.test.js'); testConfig = require('./webpack.test.js');
// console.log(JSON.stringify(testConfig, null, '\t'));
helpers.removeLoaders(testConfig, ['ts']); helpers.removeLoaders(testConfig, ['ts']);
module.exports = webpackMerge(testConfig, { 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: [ rules: [
{ {
test: /\.ts$/, test: /\.ts$/,

2
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 * Source map for Karma from the help of karma-sourcemap-loader & karma-webpack
* *
* Do not change, leave as is or it wont work. * 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', devtool: 'inline-source-map',
}); });
Loading…
Cancel
Save