Skip to content

Commit

Permalink
feat(theme): provide non-minified theme (#635)
Browse files Browse the repository at this point in the history
  • Loading branch information
shortcuts authored Jul 23, 2021
1 parent 99f7c84 commit ca49d60
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 17 deletions.
2 changes: 1 addition & 1 deletion bundlesize.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"maxSize": "4 kB"
},
{
"path": "packages/autocomplete-theme-classic/dist/theme.css",
"path": "packages/autocomplete-theme-classic/dist/theme.min.css",
"maxSize": "4.25 kB"
}
]
Expand Down
10 changes: 6 additions & 4 deletions packages/autocomplete-theme-classic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@
"files": [
"dist/"
],
"main": "dist/theme.css",
"unpkg": "dist/theme.css",
"jsdelivr": "dist/theme.css",
"main": "dist/theme.min.css",
"unpkg": "dist/theme.min.css",
"jsdelivr": "dist/theme.min.css",
"scripts": {
"build:clean": "rm -rf ./dist",
"build:css": "node ../../scripts/buildCss.mjs src/theme.scss dist/theme.css",
"build:css": "yarn build:css:minified && yarn build:css:unminified",
"build:css:minified": "MINIFIED=TRUE node ../../scripts/buildCss.mjs src/theme.scss dist/theme.min.css",
"build:css:unminified": "node ../../scripts/buildCss.mjs src/theme.scss dist/theme.css",
"build": "yarn build:clean && yarn build:css",
"on:change": "yarn build:css",
"prepare": "yarn build:css",
Expand Down
26 changes: 14 additions & 12 deletions postcss.config.mjs
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
import sass from '@csstools/postcss-sass';
import autoprefixer from 'autoprefixer';
import cssnano from 'cssnano';
import color from 'postcss-color-rgb';
import comment from 'postcss-comment';
import sass from '@csstools/postcss-sass';
import presetEnv from 'postcss-preset-env';

const MINIFIED = process.env.MINIFIED;
const plugins = [
presetEnv({
features: {
'nesting-rules': false,
},
}),
color,
sass,
autoprefixer,
];

export default {
parser: comment,
plugins: [
presetEnv({
features: {
'nesting-rules': false,
},
}),
color,
sass,
autoprefixer,
cssnano,
],
plugins: MINIFIED ? [...plugins, cssnano] : plugins,
};

0 comments on commit ca49d60

Please sign in to comment.