mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
fixed webpack.test config
This commit is contained in:
@@ -1,8 +1,13 @@
|
||||
const {
|
||||
projectRoot,
|
||||
buildRoot,
|
||||
themedTest,
|
||||
themedUse,
|
||||
themePath,
|
||||
globalCSSImports,
|
||||
themeReplaceOptions
|
||||
} = require('./helpers');
|
||||
const path = require('path');
|
||||
|
||||
/**
|
||||
* Webpack Plugins
|
||||
@@ -25,7 +30,7 @@ const ENV = process.env.ENV = process.env.NODE_ENV = 'test';
|
||||
*
|
||||
* See: http://webpack.github.io/docs/configuration.html#cli
|
||||
*/
|
||||
module.exports = function (options) {
|
||||
module.exports = function (env) {
|
||||
return {
|
||||
mode: 'development',
|
||||
/**
|
||||
@@ -76,16 +81,12 @@ module.exports = function (options) {
|
||||
* See: https://github.com/webpack/source-map-loader
|
||||
*/
|
||||
{
|
||||
enforce: 'pre',
|
||||
test: /\.js$/,
|
||||
loader: 'source-map-loader',
|
||||
exclude: [/node_modules/],
|
||||
|
||||
test: (filePath) => themedTest(filePath, 'scss'),
|
||||
use: (info) => themedUse(info.resource, 'scss')
|
||||
},
|
||||
{
|
||||
test: /\.component.ts$/,
|
||||
loader: 'string-replace-loader',
|
||||
options: themeReplaceOptions
|
||||
test: (filePath) => themedTest(filePath, 'html'),
|
||||
use: (info) => themedUse(info.resource, 'html')
|
||||
},
|
||||
/**
|
||||
* Typescript loader support for .ts and Angular 2 async routes via .async.ts
|
||||
@@ -142,6 +143,11 @@ module.exports = function (options) {
|
||||
*/
|
||||
{
|
||||
test: /\.scss$/,
|
||||
exclude: [
|
||||
/node_modules/,
|
||||
buildRoot('styles/_exposed_variables.scss', env),
|
||||
buildRoot('styles/_variables.scss', env)
|
||||
],
|
||||
use: [
|
||||
{
|
||||
loader: 'raw-loader',
|
||||
@@ -149,6 +155,12 @@ module.exports = function (options) {
|
||||
sourceMap: true
|
||||
}
|
||||
},
|
||||
{
|
||||
loader: 'postcss-loader',
|
||||
options: {
|
||||
sourceMap: true
|
||||
}
|
||||
},
|
||||
{
|
||||
loader: 'resolve-url-loader',
|
||||
options: {
|
||||
@@ -157,21 +169,57 @@ module.exports = function (options) {
|
||||
},
|
||||
{
|
||||
loader: 'sass-loader',
|
||||
options: {
|
||||
sourceMap: true,
|
||||
includePaths: [path.join(themePath, 'styles')]
|
||||
}
|
||||
},
|
||||
{
|
||||
loader: 'sass-resources-loader',
|
||||
options: {
|
||||
resources: globalCSSImports(env)
|
||||
},
|
||||
},
|
||||
{
|
||||
loader: 'string-replace-loader',
|
||||
options: themeReplaceOptions
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
test: /(_exposed)?_variables.scss$/,
|
||||
exclude: [/node_modules/],
|
||||
use: [
|
||||
{
|
||||
loader: 'css-loader',
|
||||
options: {
|
||||
sourceMap: true,
|
||||
modules: true
|
||||
}
|
||||
},
|
||||
{
|
||||
loader: 'postcss-loader',
|
||||
options: {
|
||||
sourceMap: true
|
||||
}
|
||||
},
|
||||
{
|
||||
loader: 'resolve-url-loader',
|
||||
options: {
|
||||
sourceMap: true
|
||||
}
|
||||
},
|
||||
{
|
||||
loader: 'sass-loader',
|
||||
options: {
|
||||
sourceMap: true,
|
||||
includePaths: [path.join(themePath, 'styles')]
|
||||
}
|
||||
},
|
||||
{
|
||||
loader: 'string-replace-loader',
|
||||
options: themeReplaceOptions
|
||||
},
|
||||
{
|
||||
loader: 'sass-resources-loader',
|
||||
options: {
|
||||
resources: globalCSSImports
|
||||
},
|
||||
},
|
||||
'webpack-import-glob-loader'
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
|
Reference in New Issue
Block a user