Inside a scss file, I\'m trying to import custom, widely used chunk of scss (in a React/SASS/Webpack stack).
So that I can use a shared mixin.
Let\'s say I\'m cr
You could add stylesheets to the Webpack modules with resolve.modules
// webpack.config.js
const path = require('path')
module.exports = {
// ...
resolve: {
modules: [
'node_modules',
path.join(__dirname, 'path/to/stylesheets'),
],
},
}
And sass-loader allows you to import _common-btn-styles.scss from the modules. https://webpack.js.org/loaders/sass-loader/#resolving-import-at-rules
@import "~_common-btn-styles.scss";
.my-admin-btn {
// Use the shared mixins
}