sass-brunch | Adds Sass / Scss support to brunch | Style Language library
kandi X-RAY | sass-brunch Summary
kandi X-RAY | sass-brunch Summary
Adds Sass support to Brunch.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of sass-brunch
sass-brunch Key Features
sass-brunch Examples and Code Snippets
Community Discussions
Trending Discussions on sass-brunch
QUESTION
I was trying out Vue, first with Webpack, it worked smoothly, so now I'm trying to integrate it with Brunch since it is what Phoenix uses but I get this mysterious error:
Cannot find module 'babel-runtime/core-js/json/stringify'
I tried to copy all babel related dependencies from my original Webpack project's package.json
but I still get the same error and I have no idea why.
I tried using yarn, tried removing node_modules
and then reinstalling, tried different versions of babel-runtime to no avail.
My current package.json looks like this:
ANSWER
Answered 2017-Oct-16 at 15:47From what I've gathered this has to do with how brunch loads it modules. Your entry file needs to 'bootstrap' all the other modules it will use.
Try adding this line to your entry file
import 'babel-runtime/core-js/json/stringify';
You will likely also need to require other modules you'll need in your app from the main file as well, you don't need to use them in the main file but in order to require them in a component or another file that isn't your main one you need to do this 'bootstrapping.'
QUESTION
On my Phoenix project, I found a peculiar behavior of sass-brunch
.
Here are the short descriptions of my problem:
- It generates a correct
app.css
on thepriv/static/css
directory when the Phoenix server started in dev envrionment. - When I modify one of SCSS files, the
app.css
gets generated but lacks only the lines from the modified SCSS file. It keeps the lines from the unmodified files. - This problem occurs on Ubuntu 16.04, but not on macOS.
On the log file, I noticed an entry that may be related to this issue:
[debug] Duplicate channel join for topic "phoenix:live_reload" in Phoenix.LiveReloader.Socket. Closing existing channel for new join.
I don't see such a line on my Mac.
My environment:
- Ubuntu 16.04 Desktop
- Phoenix 1.2.5
- Node.js 8.9.1
- npm 5.5.1
- Brunch 2.10.7
- sass-brunch 2.10.4
My package.json
:
{
"repository": {},
"license": "MIT",
"scripts": {
"deploy": "brunch build --production",
"watch": "brunch watch --stdin"
},
"dependencies": {
"phoenix": "file:deps/phoenix",
"phoenix_html": "file:deps/phoenix_html"
},
"devDependencies": {
"babel-brunch": "6.0.6",
"brunch": "2.10.7",
"clean-css-brunch": "2.10.0",
"sass-brunch": "^2.10.4",
"uglify-js-brunch": "2.1.1"
}
}
[UPDATE]
I found an interesting fact.
- When I edit SCSS files using vim, the
app.css
gets generated normally. - When I edit them using atom, things do not go well.
ANSWER
Answered 2017-Nov-15 at 11:37I found a workaround to my problem.
Put these lines to the brunch-config.js
:
watcher: {
usePolling: true
}
As the documentation of Brunch says, watcher gets slower but can be more reliable by setting true
to this option.
The usePolling
option is passed to chokidar, whose document says:
usePolling
(default:false
). Whether to use fs.watchFile (backed by polling), or fs.watch. If polling leads to high CPU utilization, consider setting this tofalse
. It is typically necessary to set this totrue
to successfully watch files over a network, and it may be necessary to successfully watch files in other non-standard situations.
QUESTION
Out of the blue build script started to fail. No changes in environment or configs at all. Works fine in dev, fails in prod.
Both dev and prod (both Ubuntus):
...ANSWER
Answered 2017-Aug-12 at 04:26"bootstrap": "^4.0.0-alpha.6"
QUESTION
I'm building out an app that has multiple entry points. It's a plugin/sideloading react architecture.
I have a base react app compiling into app.js and vendor.js just fine. The issue originates with the secondary project, the theme, being bundled with some of the same dependencies. Most notably react and react-dom. I would like to be able to use conventions.ignored to instruct brunch to ignore specific node_modules and their dependencies. Regardless of the regex I put in conventions.ignored I still get react and react-dom in the theme_vendor.js bundle. See config below:
...ANSWER
Answered 2017-Apr-20 at 20:42I think you need to do this:
QUESTION
I wanted to try out Brunch and am having some trouble getting my compiled JS files to execute in the browser.
The file gets compiled and loaded by the page into the browser. If I stick an alert or a console log in the source files and do a build, then nothing happens when I load the page.
If I edit the file manually and put a console log or an alert into it then it works just fine.
Does anyone have any ideas? I feel like I'm probably just missing something silly.
This is what I have in my brunch config file
...ANSWER
Answered 2017-Mar-20 at 02:52are you requiring the build in your html?
see below:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install sass-brunch
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page