-
Notifications
You must be signed in to change notification settings - Fork 37
/
webpack.mix.js
43 lines (31 loc) · 1.22 KB
/
webpack.mix.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
Copyright the Inclusive Design Guide copyright holders.
See the AUTHORS.md file at the top-level directory of this distribution and at
https://github.com/inclusive-design/guide.inclusivedesign.ca/raw/main/AUTHORS.md.
Licensed under the New BSD license. You may not use this file except in compliance with this License.
You may obtain a copy of the New BSD License at
https://github.com/inclusive-design/guide.inclusivedesign.ca/raw/main/LICENSE.md.
*/
"use strict";
const mix = require("laravel-mix");
const moveFile = require("move-file");
// Set public path.
mix.setPublicPath("dist/assets");
// Process JavaScript with Babel.
mix.js("./src/assets/scripts/app.js", "dist/assets/scripts");
// Compile Stylus and process with PostCSS.
mix.postCss("./src/assets/styles/app.css", "dist/assets/styles");
// Don't modify stylesheet url() functions.
mix.options({
processCssUrls: false
});
// Enable source maps.
mix.sourceMaps(false, "source-map");
// Add version string to assets in production.
if (mix.inProduction()) {
mix.version();
}
// Copy asset manifest into Eleventy's data directory to trigger a build when assets are updated.
mix.then(() => {
moveFile.sync("dist/assets/mix-manifest.json", "src/_data/assets.json");
});