Skip to content

Commit

Permalink
feat: library refactor, mixin webpack, globally import
Browse files Browse the repository at this point in the history
  • Loading branch information
emircanerkul committed Sep 16, 2022
1 parent 33f37eb commit bd6f174
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
12 changes: 0 additions & 12 deletions emulsify.libraries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,9 @@ global:
theme:
dist/css/global.css: {}

main-menu:
js:
dist/js/02-molecules/menus/main-menu/main-menu.js: {}
dependencies:
- core/drupal

# IE 11 support for SVG use - disable if not needed.
# See also components/01-atoms/images/icons/_icon.twig to remove attach_library.
sprite:
js:
components/01-atoms/images/icons/svgxuse.min.js:
{ attributes: { defer: true } }

tabs:
js:
dist/js/02-molecules/tabs/tabs.js: {}
dependencies:
- core/drupal
5 changes: 5 additions & 0 deletions webpack/loaders.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const path = require('path');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const globImporter = require('node-sass-glob-importer');

Expand Down Expand Up @@ -35,6 +36,10 @@ const CSSLoader = {
loader: 'sass-loader',
options: {
sourceMap: true,
additionalData: `@import "${path.resolve(
__dirname,
'../components/_import.scss',
)}";`,
sassOptions: {
importer: globImporter(),
outputStyle: 'compressed',
Expand Down
2 changes: 1 addition & 1 deletion webpack/webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ module.exports = {
entry: getEntries(
path.resolve(
rootDir,
'components/**/!(*.stories|*.component|*.min|*.test).js',
'components/**/!(*.stories|*.component|*.min|*.mixin|*.test).js',
),
path.resolve(rootDir, 'components/**/*.component.scss'),
),
Expand Down

0 comments on commit bd6f174

Please sign in to comment.