mirror of
https://github.com/a2nt/silverstripe-webpack.git
synced 2024-10-22 17:05:31 +02:00
Page type SCSS includes
This commit is contained in:
parent
dcc1385687
commit
7531889184
10
site/src/scss/_bootstrap_variables.scss
Normal file
10
site/src/scss/_bootstrap_variables.scss
Normal file
@ -0,0 +1,10 @@
|
||||
@import "~bootstrap/scss/functions";
|
||||
@import "~bootstrap/scss/variables";
|
||||
@import "~bootstrap/scss/mixins";
|
||||
|
||||
// bootstrap minify bugfix:
|
||||
$navbar-dark-toggler-icon-bg: none;
|
||||
$navbar-light-toggler-icon-bg: none;
|
||||
|
||||
// IE > 9
|
||||
$enable-flex: true;
|
@ -1,10 +1,5 @@
|
||||
@import "_bootstrap_variables";
|
||||
|
||||
/*
|
||||
* Your custom variables
|
||||
*/
|
||||
|
||||
// bootstrap minify bugfix:
|
||||
$navbar-dark-toggler-icon-bg: none;
|
||||
$navbar-light-toggler-icon-bg: none;
|
||||
|
||||
// IE > 9
|
||||
$enable-flex: true;
|
||||
*/
|
@ -1,10 +1,6 @@
|
||||
// Your custom variables
|
||||
@import "variables";
|
||||
|
||||
// Bootstrap basics
|
||||
@import "~bootstrap/scss/functions";
|
||||
@import "~bootstrap/scss/variables";
|
||||
@import "~bootstrap/scss/mixins";
|
||||
@import "_bootstrap_variables";
|
||||
|
||||
@import "~bootstrap/scss/root";
|
||||
@import "~bootstrap/scss/reboot";
|
||||
@import "~bootstrap/scss/type";
|
||||
@ -38,9 +34,12 @@
|
||||
@import "~bootstrap/scss/utilities";
|
||||
@import "~bootstrap/scss/print";
|
||||
|
||||
// Font Awesome
|
||||
$fa-font-path: "~font-awesome/fonts";
|
||||
@import "~font-awesome/scss/font-awesome";
|
||||
|
||||
// Your custom variables
|
||||
@import "_variables";
|
||||
|
||||
// Your custom UI
|
||||
@import "layout";
|
||||
@import "types/typography";
|
||||
@import "_layout";
|
1
site/src/scss/types/HomePage.scss
Normal file
1
site/src/scss/types/HomePage.scss
Normal file
@ -0,0 +1 @@
|
||||
@import "../variables";
|
1
site/src/scss/types/typography.scss
Normal file
1
site/src/scss/types/typography.scss
Normal file
@ -0,0 +1 @@
|
||||
@import "../variables";
|
@ -5,7 +5,7 @@ const ManifestPlugin = require("webpack-manifest-plugin");
|
||||
const conf = require("./webpack.configuration");
|
||||
const isProduction = process.env.NODE_ENV === "production";
|
||||
|
||||
const jsScripts = {
|
||||
const includes = {
|
||||
app: path.join(conf.SRC, "js/app.js"),
|
||||
};
|
||||
|
||||
@ -30,11 +30,17 @@ const _getAllFilesFromFolder = function(dir) {
|
||||
// add page specific scripts
|
||||
const pageScripts = _getAllFilesFromFolder(conf.PAGES);
|
||||
pageScripts.forEach((file) => {
|
||||
jsScripts[path.basename(file, ".js")] = file;
|
||||
includes[path.basename(file, ".js")] = file;
|
||||
});
|
||||
|
||||
// add page specific scss
|
||||
const scssIncludes = _getAllFilesFromFolder(conf.PAGESSCSS);
|
||||
scssIncludes.forEach((file) => {
|
||||
includes[path.basename(file, ".scss")] = file;
|
||||
});
|
||||
|
||||
module.exports = {
|
||||
entry: jsScripts,
|
||||
entry: includes,
|
||||
devtool: "source-map",
|
||||
externals: {
|
||||
"jquery": "jQuery",
|
||||
@ -58,6 +64,13 @@ module.exports = {
|
||||
]
|
||||
},
|
||||
}
|
||||
}, {
|
||||
test: /\.tsx?$/,
|
||||
use: 'ts-loader',
|
||||
exclude: /node_modules/
|
||||
}, {
|
||||
test: /\.coffee?$/,
|
||||
use: 'coffee-loader'
|
||||
}, {
|
||||
test: /\.(png|jpg|gif|svg)$/,
|
||||
loader: "file-loader",
|
||||
@ -71,6 +84,12 @@ module.exports = {
|
||||
}
|
||||
}]
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
'jquery': require.resolve('jquery'),
|
||||
'jQuery': require.resolve('jquery'),
|
||||
}
|
||||
},
|
||||
plugins: [
|
||||
new webpack.ProvidePlugin({
|
||||
$: "jquery",
|
||||
|
Loading…
Reference in New Issue
Block a user