Skip to content

Commit

Permalink
Replace scss to css compiler while rollup (#1857)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkszepp authored Nov 11, 2024
1 parent 913c85e commit 2e9af6b
Show file tree
Hide file tree
Showing 3 changed files with 2,514 additions and 3,480 deletions.
3 changes: 1 addition & 2 deletions ember-power-select/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,11 @@
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-n": "^17.10.2",
"eslint-plugin-prettier": "^5.2.1",
"node-sass": "^9.0.0",
"postcss": "^8.4.43",
"prettier": "^3.3.3",
"prettier-plugin-ember-template-tag": "^2.0.2",
"rollup": "^4.21.2",
"rollup-plugin-styles": "^4.0.0",
"rollup-plugin-sass": "^1.13.2",
"rsvp": "^4.8.5",
"sass": "^1.77.8",
"typescript": "^5.5.4",
Expand Down
80 changes: 69 additions & 11 deletions ember-power-select/rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { babel } from '@rollup/plugin-babel';
import { Addon } from '@embroider/addon-dev/rollup';
import styles from 'rollup-plugin-styles';
import sass from 'rollup-plugin-sass';
import postcss from 'postcss';
import path from 'path';

const addon = new Addon({
Expand All @@ -17,44 +18,101 @@ export default [
assetFileNames: '[name][extname]',
},
plugins: [
styles({
mode: ['extract', 'ember-power-select.css'],
sass: {
sass({
options: {
includePaths: [path.resolve('node_modules')],
},
}),
output: './vendor/ember-power-select.css',
})
],
},
{
input: './_index.scss',
output: {
file: './vendor/ember-power-select.js',
assetFileNames: '[name][extname]',
},
plugins: [
sass({
options: {
includePaths: [path.resolve('node_modules')],
},
processor: css => postcss()
.process(css, {
from: undefined,
})
.then(result => result.css)
})
]
},
{
input: './scss/bootstrap-complete.scss',
output: {
file: './vendor/ember-power-select-bootstrap.js',
assetFileNames: '[name][extname]',
},
plugins: [
styles({
mode: ['extract', 'ember-power-select-bootstrap.css'],
sass: {
sass({
options: {
includePaths: [path.resolve('node_modules')],
},
output: './vendor/ember-power-select-bootstrap.css',
}),
],
},
{
input: './scss/bootstrap-complete.scss',
output: {
file: './vendor/ember-power-select-bootstrap.js',
assetFileNames: '[name][extname]',
},
plugins: [
sass({
options: {
includePaths: [path.resolve('node_modules')],
},
processor: css => postcss()
.process(css, {
from: undefined,
})
.then(result => result.css)
})
]
},
{
input: './scss/material-complete.scss',
output: {
file: './vendor/ember-power-select-material.js',
assetFileNames: '[name][extname]',
},
plugins: [
styles({
mode: ['extract', 'ember-power-select-material.css'],
sass: {
sass({
options: {
includePaths: [path.resolve('node_modules')],
},
output: './vendor/ember-power-select-material.css',
}),
],
},
{
input: './scss/material-complete.scss',
output: {
file: './vendor/ember-power-select-material.js',
assetFileNames: '[name][extname]',
},
plugins: [
sass({
options: {
includePaths: [path.resolve('node_modules')],
},
processor: css => postcss()
.process(css, {
from: undefined,
})
.then(result => result.css)
})
]
},
{
// This provides defaults that work well alongside `publicEntrypoints` below.
// You can augment this if you need to.
Expand Down
Loading

0 comments on commit 2e9af6b

Please sign in to comment.