Skip to content
This repository has been archived by the owner on May 1, 2020. It is now read-only.

FR: import 3rd part css files from node_module folder without need to copy sass.config.js to local folder #777

Closed
mburger81 opened this issue Feb 23, 2017 · 3 comments

Comments

@mburger81
Copy link
Contributor

Short description of the problem:

If I want to import from a component scss file a 3rd part css file from node_moduls folder like this
component.scss:
@import "ngx-datatable/release/index";

We have to copy sass.config.js to local project folder where we configure custom includePaths like this

includePaths: [
    ....
    'node_modules/@swimlane'
 ],

and at the end we have to configure in package.json the scripts to include custom sass configuration file, like this:

"scripts": {
    .....
    "ionic:serve": "ionic-app-scripts serve -s ./config/sass.config.js"
 },

This is working fine, but there is one problem, always when we update ionic-app-scripts we have to compare the native sass.config.js file to the local file and check if there is anything changed! This could be a problem and a point of failure.

What behavior are you expecting?

It would be better if there is a possibility to handle ionic-app-scripts customization or at least custom includePaths in a other way. For example a second local configuration file or something like that.

Otherwise it is troublesome to manage and compare the customized file with the original file

What do you think?

Which @ionic/app-scripts version are you using?
1.1.3

@danbucholtz
Copy link
Contributor

Configs are extended, so only include the fields that you're changing. Everything else will inherit the defaults.

Thanks,
Dan

@mburger81
Copy link
Contributor Author

@danbucholtz Yes I can doing something like that in my sass.config.js file

module.exports = {
  /**
   * includePaths: Used by node-sass for additional
   * paths to search for sass imports by just name.
   */
  includePaths: [
    'node_modules/ionic-angular/themes',
    'node_modules/ionicons/dist/scss',
    'node_modules/ionic-angular/fonts',
    'node_modules/@swimlane'
  ]
}

but I have still to copy the other included paths from ionic default, which is still not so nice in my opinion.
I didn't found nothing how I can only extend includePaths

@danbucholtz
Copy link
Contributor

@mburger81,

Yeah, it's not the best, but it's good enough for now. This stuff isn't going to change that often that it is a management concern. Object.assign was the best we could come up with. It could be worse, many other projects with baked in build processes don't let you customize at all!

Thanks,
Dan

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants