Skip to content

Commit f1cfecb

Browse files
committed
changes
- fix errors when running individual tasks - remove wrap theme plugin - add htmlSearchPaths option - disable RTL by default - disable Sass $theme variable injection by default
1 parent 14c956f commit f1cfecb

File tree

4 files changed

+24
-79
lines changed

4 files changed

+24
-79
lines changed

README.md

+15-3
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,18 @@ runTasks:
7777
copy: true
7878
sass: true
7979
html: true
80-
enableCssThemes: true
81-
enableCssRTL: true
80+
# injects $theme Sass variable
81+
enableCssThemes: false
82+
# create additional .rtl.css
83+
enableCssRTL: false
84+
# expose globals
85+
expose: []
86+
# copy assets list i.e.
87+
# copyCwd: node_modules
88+
# copyDest: dist/assets/vendor
89+
# copy:
90+
# - bootstrap/dist/bootstrap.js
91+
# => will copy node_modules/bootstrap/dist/bootstrap.js to dist/assets/vendor/bootstrap.js
8292
copyCwd: node_modules
8393
copyDest: dist/assets/vendor
8494
copy:
@@ -94,8 +104,10 @@ sassSrc: src/sass/*.scss
94104
cssDest: dist/assets/css
95105
jsSrc: src/js/**/**.{js,vue}
96106
jsDest: dist/assets/js
107+
htmlSearchPaths:
108+
- ./src/html
97109
htmlDest: dist/[path][name].html
98-
htmllint: true,
110+
htmllint: false
99111
laravelMixOptions:
100112
processCssUrls: false
101113
browserSync:

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "theme-mix",
3-
"version": "1.1.1",
3+
"version": "1.2.0",
44
"author": "FrontendMatter <contact@frontendmatter.com> (http://www.frontendmatter.com)",
55
"dependencies": {
66
"async": "^2.4.1",

webpack-wrap-theme-plugin.js

-48
This file was deleted.

webpack.mix.js

+8-27
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ config.merge({
2020
sass: true,
2121
html: true,
2222
},
23-
enableCssThemes: true,
23+
enableCssThemes: false,
2424
// create additional .rtl.css
25-
enableCssRTL: true,
25+
enableCssRTL: false,
2626
// expose globals
2727
expose: [],
2828
// copy assets list i.e.
@@ -41,6 +41,9 @@ config.merge({
4141
cssDest: 'dist/assets/css',
4242
jsSrc: 'src/js/**/**.{js,vue}',
4343
jsDest: 'dist/assets/js',
44+
htmlSearchPaths: [
45+
'./src/html'
46+
],
4447
htmlDest: 'dist/[path][name].html',
4548
htmllint: true,
4649
// options passed to laravel-mix
@@ -194,10 +197,10 @@ mix.extend('addSassIncludePaths', function(webpackConfig) {
194197
)
195198
})
196199

197-
mix.addSassIncludePaths()
198-
199200
// npm run development -- --env.run sass
200201
if (__RUN === 'sass' || (!__RUN && config.get('runTasks:sass'))) {
202+
mix.addSassIncludePaths()
203+
201204
let __DIST_CSS = config.get('cssDest')
202205

203206
let sassOptions = {
@@ -239,26 +242,6 @@ if (__RUN === 'sass' || (!__RUN && config.get('runTasks:sass'))) {
239242
]
240243
})
241244
}
242-
243-
///////////////////////////////////
244-
// WRAP CSS with .theme-$__THEME //
245-
///////////////////////////////////
246-
247-
if (config.get('enableCssThemes')) {
248-
const WebpackWrapThemePlugin = require('./webpack-wrap-theme-plugin')
249-
const cacheDirectory = path.resolve(path.join('temp', 'themeClass', __THEME))
250-
251-
del.sync(cacheDirectory)
252-
253-
webpackConfig = merge(webpackConfig, {
254-
plugins: [
255-
new WebpackWrapThemePlugin({
256-
themeClass: '.theme-' + __THEME,
257-
cacheDirectory
258-
})
259-
]
260-
})
261-
}
262245
}
263246

264247
//////////////
@@ -292,9 +275,7 @@ if (__RUN === 'html' || (!__RUN && config.get('runTasks:html'))) {
292275
loaders = loaders.concat(['jsbeautify-loader', {
293276
loader: 'nunjucks-html-loader',
294277
options: {
295-
searchPaths: [
296-
'./src/html'
297-
]
278+
searchPaths: config.get('htmlSearchPaths')
298279
}
299280
}, 'front-matter-loader'])
300281

0 commit comments

Comments
 (0)