flyntwp / flynt

Component based WordPress starter theme, powered by ACF Pro and Timber, optimized for a11y and fast page load results.
https://flyntwp.com
MIT License
734 stars 84 forks source link

Swap absolute paths with relative ones when importing NPM based SCSS partials. #305

Closed code-r-man closed 4 years ago

code-r-man commented 4 years ago

Overview of the Issue: SCSS partials are currently imported using absolute paths. For example in main.scss file: @import '../node_modules/easings-css/easings';

Motivation or Use Case: Import code is longer than needed and prone to typographical errors. Any future change in folder/path structure might introduce errors as all the instances of the path need to be manually updated.

Suggest a Fix: This can be fixed, buy adding node_modules path in the webpack.config.js file at line #71, like so: includePaths: ['node_modules'],

SCSS partial files can be then referenced using the relative paths, like so: @import 'easings-css/easings';

domtra commented 4 years ago

@code-r-man , hi Nikola, thanks for your input. This is fixed by #314. I did not even have to change the webpack / scss config. I is probably already resolved because of https://github.com/flyntwp/flynt/blob/master/webpack.config.js#L81 in an overall webpack way.