mirror of https://github.com/Squidex/squidex.git
13 changed files with 223 additions and 196 deletions
@ -0,0 +1,100 @@ |
|||||
|
// ReSharper disable InconsistentNaming
|
||||
|
// ReSharper disable PossiblyUnassignedProperty
|
||||
|
|
||||
|
var webpack = require('webpack'), |
||||
|
path = require('path'), |
||||
|
HtmlWebpackPlugin = require('html-webpack-plugin'), |
||||
|
ExtractTextPlugin = require('extract-text-webpack-plugin'), |
||||
|
helpers = require('./helpers'); |
||||
|
|
||||
|
module.exports = { |
||||
|
/** |
||||
|
* Options affecting the resolving of modules. |
||||
|
* |
||||
|
* See: http://webpack.github.io/docs/configuration.html#resolve
|
||||
|
*/ |
||||
|
resolve: { |
||||
|
/** |
||||
|
* An array of extensions that should be used to resolve modules. |
||||
|
* |
||||
|
* See: http://webpack.github.io/docs/configuration.html#resolve-extensions
|
||||
|
*/ |
||||
|
extensions: ['.js', '.ts', '.css', '.scss'], |
||||
|
modules: [ |
||||
|
helpers.root('app'), |
||||
|
helpers.root('app', 'theme'), |
||||
|
helpers.root('app-libs'), |
||||
|
helpers.root('node_modules') |
||||
|
], |
||||
|
}, |
||||
|
|
||||
|
/* |
||||
|
* Options affecting the normal modules. |
||||
|
* |
||||
|
* See: http://webpack.github.io/docs/configuration.html#module
|
||||
|
*/ |
||||
|
module: { |
||||
|
/** |
||||
|
* An array of automatically applied loaders. |
||||
|
* |
||||
|
* 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
|
||||
|
*/ |
||||
|
loaders: [ |
||||
|
{ |
||||
|
test: /\.ts$/, |
||||
|
loaders: ['awesome-typescript', helpers.root('app-config', 'auto-loader') + '?[file].html=template&[file].scss=styles', 'tslint'] |
||||
|
}, { |
||||
|
test: /\.html$/, |
||||
|
loader: 'html' |
||||
|
}, { |
||||
|
test: /\.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|ico)(\?.*$|$)/, |
||||
|
loader: 'file?name=assets/[name].[hash].[ext]' |
||||
|
}, { |
||||
|
test: /\.css$/, |
||||
|
loader: ExtractTextPlugin.extract({ fallbackLoader: 'style', loader: 'css?sourceMap' }) |
||||
|
}, { |
||||
|
test: /\.scss$/, |
||||
|
exclude: helpers.root('app', 'theme'), |
||||
|
loaders: ['raw', 'sass'] |
||||
|
} |
||||
|
] |
||||
|
}, |
||||
|
|
||||
|
plugins: [ |
||||
|
new webpack.LoaderOptionsPlugin({ |
||||
|
options: { |
||||
|
tslint: { |
||||
|
/** |
||||
|
* Run tslint in production build and fail if there is one warning. |
||||
|
* |
||||
|
* See: https://github.com/wbuchwalter/tslint-loader
|
||||
|
*/ |
||||
|
emitErrors: false, |
||||
|
/** |
||||
|
* Share the configuration file with the IDE |
||||
|
*/ |
||||
|
configuration: require('./../tslint.json') |
||||
|
}, |
||||
|
sassLoader: { |
||||
|
includePaths: [helpers.root('app', 'theme')] |
||||
|
}, |
||||
|
context: '/' |
||||
|
} |
||||
|
}), |
||||
|
|
||||
|
new webpack.ContextReplacementPlugin(/moment[\/\\]locale$/, /en/), |
||||
|
|
||||
|
/** |
||||
|
* Shim additional libraries |
||||
|
* |
||||
|
* See: https://webpack.github.io/docs/shimming-modules.html
|
||||
|
*/ |
||||
|
new webpack.ProvidePlugin({ |
||||
|
// Mouse trap handles shortcut management
|
||||
|
'Mousetrap': 'mousetrap/mousetrap' |
||||
|
}) |
||||
|
] |
||||
|
}; |
||||
@ -1,81 +1,6 @@ |
|||||
var webpack = require('webpack'), |
var webpack = require('webpack'), |
||||
helpers = require('./helpers'); |
webpackMerge = require('webpack-merge'), |
||||
|
commonConfig = require('./webpack.config.js'), |
||||
|
helpers = require('./helpers'); |
||||
|
|
||||
module.exports = { |
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
|
|
||||
*/ |
|
||||
devtool: 'inline-source-map', |
|
||||
|
|
||||
resolve: { |
|
||||
/** |
|
||||
* An array of extensions that should be used to resolve modules. |
|
||||
* |
|
||||
* See: http://webpack.github.io/docs/configuration.html#resolve-extensions
|
|
||||
*/ |
|
||||
extensions: ['', '.ts', '.js'], |
|
||||
root: [ |
|
||||
helpers.root('app'), |
|
||||
helpers.root('app-libs') |
|
||||
] |
|
||||
}, |
|
||||
|
|
||||
/* |
|
||||
* Options affecting the normal modules. |
|
||||
* |
|
||||
* See: http://webpack.github.io/docs/configuration.html#module
|
|
||||
*/ |
|
||||
module: { |
|
||||
preLoaders: [{ |
|
||||
test: /\.ts/, |
|
||||
loader: helpers.root('app-config', 'auto-loader') + '?[file].html=template&[file].scss=styles', |
|
||||
}], |
|
||||
|
|
||||
/** |
|
||||
* An array of automatically applied loaders. |
|
||||
* |
|
||||
* 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
|
|
||||
*/ |
|
||||
loaders: [ |
|
||||
{ |
|
||||
test: /\.ts$/, |
|
||||
loader: 'awesome-typescript-loader' |
|
||||
}, { |
|
||||
test: /\.html$/, |
|
||||
loader: 'html' |
|
||||
}, { |
|
||||
test: /\.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|ico)(\?.*$|$)/, |
|
||||
loader: 'null' |
|
||||
}, { |
|
||||
test: /\.css$/, |
|
||||
loader: 'null' |
|
||||
}, { |
|
||||
test: /\.scss$/, |
|
||||
exclude: helpers.root('app', 'theme'), |
|
||||
loaders: ['raw', 'sass'] |
|
||||
} |
|
||||
] |
|
||||
}, |
|
||||
|
|
||||
sassLoader: { |
|
||||
includePaths: [helpers.root('app', 'theme')] |
|
||||
}, |
|
||||
|
|
||||
plugins: [ |
|
||||
/** |
|
||||
* Shim additional libraries |
|
||||
* |
|
||||
* See: https://webpack.github.io/docs/shimming-modules.html
|
|
||||
*/ |
|
||||
new webpack.ProvidePlugin({ |
|
||||
// Mouse trap handles shortcut management
|
|
||||
'Mousetrap': 'mousetrap/mousetrap' |
|
||||
}) |
|
||||
] |
|
||||
} |
|
||||
@ -1,5 +1,5 @@ |
|||||
{ |
{ |
||||
"identity": { |
"identity": { |
||||
"baseUrl": "https://squidex.io" |
"baseUrl": "http://squidex.io" |
||||
} |
} |
||||
} |
} |
||||
Loading…
Reference in new issue