Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Lednerb/bilberry-hugo-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'webpack.mix.js')
-rw-r--r--webpack.mix.js39
1 files changed, 34 insertions, 5 deletions
diff --git a/webpack.mix.js b/webpack.mix.js
index 93b18ad..4001931 100644
--- a/webpack.mix.js
+++ b/webpack.mix.js
@@ -11,14 +11,43 @@ let mix = require('laravel-mix');
|
*/
mix.autoload({
- jquery: ['$', 'window.jQuery', 'jQuery'],
- moment: 'moment'
+ jquery: ['$', 'window.jQuery', 'jQuery'],
+ moment: 'moment'
});
mix.setPublicPath('./static')
- .setResourceRoot('./')
- .js('assets/js/theme.js', './')
- .sass('assets/sass/theme.scss', './');
+.setResourceRoot('./')
+.js('assets/js/theme.js', './')
+.sass('assets/sass/theme.scss', './')
+.then(() => {
+ const fs = require("fs");
+ const oldFontsPath = './static/fonts/vendor';
+ const newFontsPath = './static/fonts/_vendor';
+ const themeFile = './static/theme.css';
+
+ if (fs.existsSync(newFontsPath)) {
+ fs.rmdirSync(newFontsPath, {recursive: true, force: true});
+ }
+
+ fs.rename(oldFontsPath, newFontsPath, function (err) {
+ if (err) {
+ console.log(err)
+ }
+ })
+
+ fs.readFile(themeFile, 'utf8', function (err, data) {
+ if (err) {
+ return console.log(err);
+ }
+ let result = data.replace(/vendor/g, '_vendor');
+
+ fs.writeFile(themeFile, result, 'utf8', function (err) {
+ if (err) {
+ return console.log(err);
+ }
+ });
+ });
+});
// Full API
// mix.js(src, output);