Skip to content

Commit fb12b78

Browse files
samuelpordeusdoomspork
authored andcommitted
Add DartSass to build scss assets
To build scss assets in Phoenix 1.6 we need to use DartSass alongside esbuild
1 parent 30398ba commit fb12b78

36 files changed

+128
-25042
lines changed

.gitignore

+4-1
Original file line numberDiff line numberDiff line change
@@ -77,5 +77,8 @@ tags
7777
[._]*.un~
7878

7979
/assets/node_modules/
80-
/priv/static/
80+
/priv/static/assets/
81+
/priv/static/robots-*
82+
/priv/static/robots.txt.gz
83+
/priv/static/cache_manifest.json
8184
# End of https://www.gitignore.io/api/elixir,osx,vim,linux

assets/.babelrc

-5
This file was deleted.

assets/css/app.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ $primary: $link;
2121
$footer-background-color: $link;
2222
$footer-padding: 2rem 1.5rem 2rem;
2323

24-
@import "bulma";
24+
@import "../node_modules/bulma/bulma.sass";
2525
@import "libs/_mixins";
2626
@import "libs/_ribbon";
2727
@import "errors";

assets/js/app.js

+18-9
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
1-
// We need to import the CSS so that webpack will load it.
2-
// The MiniCssExtractPlugin is used to separate it out into
3-
// its own CSS file.
4-
import css from "../css/app.scss";
5-
6-
// webpack automatically bundles all modules in your
7-
// entry points. Those entry points can be configured
8-
// in "webpack.config.js".
1+
// We import the CSS which is extracted to its own file by esbuild.
2+
// Remove this line if you add a your own CSS build pipeline (e.g postcss).
3+
4+
// If you want to use Phoenix channels, run `mix help phx.gen.channel`
5+
// to get started and then uncomment the line below.
6+
// import "./user_socket.js"
7+
8+
// You can include dependencies in two ways.
9+
//
10+
// The simplest option is to put them in assets/vendor and
11+
// import them using relative paths:
912
//
10-
// Import dependencies
13+
// import "../vendor/some-package.js"
1114
//
15+
// Alternatively, you can `npm install some-package --prefix assets` and import
16+
// them using a path starting with the package name:
17+
//
18+
// import "some-package"
19+
//
20+
1221
import "phoenix_html";
1322
import * as jsDiff from "diff";
1423
import { Socket } from "phoenix";

0 commit comments

Comments
 (0)