fix dev build

This commit is contained in:
Art Lowel
2019-06-03 17:22:55 +02:00
parent 50effd3b70
commit 8bccdac99d
9 changed files with 102 additions and 64 deletions

View File

@@ -1,3 +1,5 @@
@import '_themed_bootstrap_variables.scss';
/** Help Variables **/ /** Help Variables **/
$fa-fixed-width: 1.25rem; $fa-fixed-width: 1.25rem;
$icon-padding: 1rem; $icon-padding: 1rem;

View File

@@ -1,3 +1,5 @@
@import '_themed_custom_variables.scss';
$content-spacing: $spacer * 1.5; $content-spacing: $spacer * 1.5;
$button-height: $input-btn-padding-y * 2 + $input-btn-line-height + calculateRem($input-btn-border-width*2); $button-height: $input-btn-padding-y * 2 + $input-btn-line-height + calculateRem($input-btn-border-width*2);

View File

@@ -1,13 +1,7 @@
@import '_functions.scss'; @import '_functions.scss';
@import '../../node_modules/bootstrap/scss/functions.scss'; @import '../../node_modules/bootstrap/scss/functions.scss';
//@import '$themePath$/bootstrap_variables.scss'; @import '_bootstrap_variables.scss';
@import '../../themes/mantis/styles/bootstrap_variables.scss';
@import 'bootstrap_variables.scss';
@import '../../node_modules/bootstrap/scss/variables.scss'; @import '../../node_modules/bootstrap/scss/variables.scss';
//@import '$themePath$/custom_variables.scss'; @import '_custom_variables.scss';
@import '../../themes/mantis/styles/custom_variables.scss';
@import 'custom_variables.scss';

View File

@@ -20,18 +20,13 @@ const theme = 'mantis';
const themePath = path.normalize(path.join(__dirname, '..', 'themes', theme)); const themePath = path.normalize(path.join(__dirname, '..', 'themes', theme));
const globalCSSImports = [ const globalCSSImports = [
path.resolve(__dirname, '..', 'src/styles/_variables.scss'), buildRoot('styles/_variables.scss'),
path.resolve(__dirname, '..', 'src/styles/_mixins.scss'), buildRoot('styles/_mixins.scss'),
]; ];
const themeReplaceOptions = const themeReplaceOptions =
{ {
multiple: [ multiple: [
{
search: '$themePath$/',
replace: (themePath.length ? themePath + '/' : ''),
flags: 'g'
},
{ {
search: '@import \'~/', search: '@import \'~/',
replace: '@import \'' + projectRoot('./') + '/', replace: '@import \'' + projectRoot('./') + '/',
@@ -62,7 +57,6 @@ const themedUse = (resource, extension) => {
const themedPath = getThemedPath(resource, extension); const themedPath = getThemedPath(resource, extension);
return [ return [
//'debug-loader',
{ {
loader: 'string-replace-loader', loader: 'string-replace-loader',
options: { options: {
@@ -74,50 +68,14 @@ const themedUse = (resource, extension) => {
] ]
}; };
const cssLoaders = [
{
loader: 'raw-loader',
options: {
sourceMap: true
}
},
{
loader: 'postcss-loader',
options: {
sourceMap: true
}
},
{
loader: 'resolve-url-loader',
options: {
sourceMap: true
}
},
];
const scssLoaders = [
...cssLoaders,
{
loader: 'sass-loader',
options: {
sourceMap: true
}
},
{
loader: 'string-replace-loader',
options: themeReplaceOptions
}
];
module.exports = { module.exports = {
projectRoot, projectRoot,
buildRoot, buildRoot,
theme, theme,
themePath,
getThemedPath, getThemedPath,
themedTest, themedTest,
themedUse, themedUse,
cssLoaders,
scssLoaders,
globalCSSImports, globalCSSImports,
themeReplaceOptions themeReplaceOptions
}; };

View File

@@ -2,9 +2,10 @@ const CopyWebpackPlugin = require('copy-webpack-plugin');
const path = require('path'); const path = require('path');
const { const {
projectRoot, projectRoot,
buildRoot,
globalCSSImports, globalCSSImports,
cssLoaders, themeReplaceOptions,
scssLoaders, themePath,
themedTest, themedTest,
themedUse themedUse
} = require('./helpers'); } = require('./helpers');
@@ -41,28 +42,109 @@ module.exports = {
}, },
{ {
test: /\.css$/, test: /\.css$/,
use: cssLoaders use: [
{
loader: 'to-string-loader',
options: {
sourceMap: true
}
},
{
loader: 'css-loader',
options: {
sourceMap: true,
modules: true
}
},
{
loader: 'postcss-loader',
options: {
sourceMap: true
}
}
]
}, },
{ {
test: /\.scss$/, test: /\.scss$/,
exclude: [/node_modules/, exclude: [
path.resolve(__dirname, '..', 'src/styles/_exposed_variables.scss'), /node_modules/,
path.resolve(__dirname, '..', 'src/styles/_variables.scss') buildRoot('styles/_exposed_variables.scss'),
buildRoot('styles/_variables.scss')
], ],
use: [ use: [
...scssLoaders, {
loader: 'raw-loader',
options: {
sourceMap: 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')]
}
},
'debug-loader',
{ {
loader: 'sass-resources-loader', loader: 'sass-resources-loader',
options: { options: {
resources: globalCSSImports resources: globalCSSImports
}, },
},
{
loader: 'string-replace-loader',
options: themeReplaceOptions
} }
] ]
}, },
{ {
test: /^(_exposed)?_variables.scss$/, test: /(_exposed)?_variables.scss$/,
exclude: /node_modules/, exclude: [/node_modules/],
use: scssLoaders 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
}
]
}, },
{ {
test: /\.html$/, test: /\.html$/,