SASS not being used even when specified
Cannot get the CLI to initialize a new project with SASS as default.
I have tried:
preact create app --name dashboard --sass --dest dashboard --type full(inits with less)preact create app --sassor evenpreact create app --sass=true(inits with css)
node -v: v6.9.0
npm -v: 3.10.8
yep, I also notice this now, I believe the loader is not being identified
the less flag works fine
I also check the package.json And I did not find the loader for sass listed, I'll check if this is what is causing the problem
Yep, it seems to work fine after adding the dependencies i just wanna check with @developit to see if I'm not missing something and then I will send the PR.
thanks @vitormalencar! I added the deps to a local fork and it still references css/less only. Looking forward to a PR.
Is it expected that all install types (--type) be able to init with preprocessor of choice?
@david-potgieter
I changed directly the package.json that was generated inside the preact-cli folder in node_modules when I run the preact create app --sass command
Adding the loader to sass (I believe the npm link can help testing in the local fork)
And then I changed the file extension fot style.css to style.scss
I do not know if it is the plan but it I think that would be nice if the flags generate the code already with the correct extensions for each .less or .scss / sass option.
I would love to contribute to this too,
I forked the repo - yarn'd the missing dependencies, rebuilt and then used the local fork to generate the app. But did not try and
And then I changed the file extension fot style.css to style.scss
Totally agreed that the CLI should most likely generate the correct file and extensions based on flags. Will see if I can get an example changed to include the correct file and extension.
@david-potgieter How did you use the local fork to generate the app?
I did not test directly modifying the cli,
I added the dependencies directly in app / node_modules / preact-cli / package.json
After the app was created with the CLI.

@vitormalencar
- I forked the repo
- cloned the fork into
~/path/preact-cli yarn- made my changes to the cli
yarn build
then
node ~/path/preact-cli/lib/index.js create app --sass --type simple
Currently working on extending the examples to optionally copy *.scss/*.less/*.css across. Can share the branch with you once I push should you wish to have a look?
sure! I will be glad to help 😄
Great - will work more on it tomorrow. Thanks for the help so far!
Ahh - yeah the --less / --sass flags actually don't affect the app generated by create at all right now. I think you guys are proposing that preact create output .css files by default but if run with -less/--sass it rename those accordingly? If so, that'd be great!
Just for clarity - .css will always just be the CSS pipeline, not sass/less. Those two are only triggered by files with the corresponding extension.
@developit - yeps indeed. I am working on making sass/less/css versions of all the examples so it can deliver the correct type once specified via the cli.
Yep that would be the idea,
I also saw others CLI going by another way and interpreting all css extensions like .less .sass .stylus and the build would compile anything to CSS, this would remove the necessity of the flags.
But I prefer the original idea of generating the extensions based on the CLI flags.
> preact create --name test --sass
Not enough non-option arguments: got 0, need at least 1
If you want to use SASS:
-
Create an app with sass option:
> preact create test --sass -
Rename *.less to *.scss
-
Convert content less files to sass by using http://less2scss.awk5.com/
-
npm start
hey all, I tried to create an app using v1.3.0 with:
preact create appname --stylus
and got an err with a message from -h:
Optionen:
--cwd A directory to use instead of $PWD. [Standard: .]
--name directory and package name for the new app
--dest Directory to create the app within [Standard: <name>]
--type A project template to start from
[Möglichkeiten: "default", "root", "simple", "empty"] [Standard: "default"]
--less Pre-install LESS support [boolean] [Standard: false]
--sass Pre-install SASS/SCSS support [boolean] [Standard: false]
--install Install dependencies [boolean] [Standard: true]
-h, --help Hilfe anzeigen [boolean]
Unbekanntes Argument: stylus
[Unknown Argument: stylus]
As following the Readme, where --stylus-option is mentioned, I assume it's not yet in the preact-cli?
@vedam Stylus will be in preact-cli 1.4.0. The master branch is for development
In v1.4.0, default styling is set to .css and based on the arguments specified --less or --sass or --stylus you can configure the project.
PR for this - #230