Page type SCSS includes

This commit is contained in:
Tony Air 2018-02-21 17:19:51 +07:00
parent dcc1385687
commit 7531889184
6 changed files with 44 additions and 19 deletions

View 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;

View File

@ -1,10 +1,5 @@
@import "_bootstrap_variables";
/* /*
* Your custom variables * Your custom variables
*/ */
// bootstrap minify bugfix:
$navbar-dark-toggler-icon-bg: none;
$navbar-light-toggler-icon-bg: none;
// IE > 9
$enable-flex: true;

View File

@ -1,10 +1,6 @@
// Your custom variables
@import "variables";
// Bootstrap basics // Bootstrap basics
@import "~bootstrap/scss/functions"; @import "_bootstrap_variables";
@import "~bootstrap/scss/variables";
@import "~bootstrap/scss/mixins";
@import "~bootstrap/scss/root"; @import "~bootstrap/scss/root";
@import "~bootstrap/scss/reboot"; @import "~bootstrap/scss/reboot";
@import "~bootstrap/scss/type"; @import "~bootstrap/scss/type";
@ -38,9 +34,12 @@
@import "~bootstrap/scss/utilities"; @import "~bootstrap/scss/utilities";
@import "~bootstrap/scss/print"; @import "~bootstrap/scss/print";
// Font Awesome
$fa-font-path: "~font-awesome/fonts"; $fa-font-path: "~font-awesome/fonts";
@import "~font-awesome/scss/font-awesome"; @import "~font-awesome/scss/font-awesome";
// Your custom variables
@import "_variables";
// Your custom UI // Your custom UI
@import "layout"; @import "types/typography";
@import "_layout";

View File

@ -0,0 +1 @@
@import "../variables";

View File

@ -0,0 +1 @@
@import "../variables";

View File

@ -5,7 +5,7 @@ const ManifestPlugin = require("webpack-manifest-plugin");
const conf = require("./webpack.configuration"); const conf = require("./webpack.configuration");
const isProduction = process.env.NODE_ENV === "production"; const isProduction = process.env.NODE_ENV === "production";
const jsScripts = { const includes = {
app: path.join(conf.SRC, "js/app.js"), app: path.join(conf.SRC, "js/app.js"),
}; };
@ -30,11 +30,17 @@ const _getAllFilesFromFolder = function(dir) {
// add page specific scripts // add page specific scripts
const pageScripts = _getAllFilesFromFolder(conf.PAGES); const pageScripts = _getAllFilesFromFolder(conf.PAGES);
pageScripts.forEach((file) => { 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 = { module.exports = {
entry: jsScripts, entry: includes,
devtool: "source-map", devtool: "source-map",
externals: { externals: {
"jquery": "jQuery", "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)$/, test: /\.(png|jpg|gif|svg)$/,
loader: "file-loader", loader: "file-loader",
@ -71,6 +84,12 @@ module.exports = {
} }
}] }]
}, },
resolve: {
alias: {
'jquery': require.resolve('jquery'),
'jQuery': require.resolve('jquery'),
}
},
plugins: [ plugins: [
new webpack.ProvidePlugin({ new webpack.ProvidePlugin({
$: "jquery", $: "jquery",