Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

Commit

Permalink
Fix the build step (#180)
Browse files Browse the repository at this point in the history
  • Loading branch information
abdonrd authored Nov 3, 2022
1 parent 32469a6 commit 69fb75a
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 60 deletions.
5 changes: 5 additions & 0 deletions .changeset/new-turkeys-doubt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@qiskit/web-components': patch
---

Fix the build step
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"scripts": {
"analyze-lit": "lit-analyzer components/**/*.ts --strict",
"build": "tsc && rollup --config rollup.config.js",
"build:ui-shell-bundle": "tsc && rollup --config rollup-ui-shell-bundle.config.js",
"dev": "npm run storybook:start",
"format": "npm-run-all format:*",
"format:eslint": "npm run lint:eslint -- --fix",
Expand All @@ -24,7 +23,7 @@
"lint": "npm-run-all --parallel lint:*",
"lint:eslint": "eslint '**/*.{js,ts}' --ignore-path .gitignore",
"lint:stylelint": "stylelint 'components/**/*.{scss,ts}' --ignore-path .gitignore",
"prepack": "npm run build && npm run build:ui-shell-bundle",
"prepack": "npm run build",
"prepare": "npx simple-git-hooks",
"release": "changeset publish",
"start": "npm run storybook:start",
Expand Down
37 changes: 0 additions & 37 deletions rollup-ui-shell-bundle.config.js

This file was deleted.

62 changes: 41 additions & 21 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

import { readdirSync } from 'fs';

import { nodeResolve } from '@rollup/plugin-node-resolve';
import terser from '@rollup/plugin-terser';
import litcss from 'rollup-plugin-lit-css';
import sass from 'sass';

Expand All @@ -27,25 +29,43 @@ const componentPaths = readdirSync('components/', { withFileTypes: true })
const iconsDirIndex = componentPaths.indexOf('icons');
componentPaths.splice(iconsDirIndex, 1);

export default componentPaths.map((component) => ({
input: `components/${component}/index.js`,
plugins: [
litcss({
include: '**/*.scss',
transform: transformSassToCss,
uglify: true,
}),
],
output: {
dir: `components/${component}/`,
format: 'esm',
sourcemap: true,
export default [
...componentPaths.map((component) => ({
input: `components/${component}/index.js`,
plugins: [
litcss({
include: '**/*.scss',
transform: transformSassToCss,
uglify: true,
}),
],
output: {
dir: `components/${component}/`,
format: 'esm',
sourcemap: true,
},
external: [
'tslib',
'lit',
/^lit\/.*/,
/^carbon-web-components\/.*/,
/^@carbon\/.*/,
],
})),
{
input: `components/ui-shell/index.js`,
plugins: [
litcss({
include: '**/*.scss',
transform: transformSassToCss,
uglify: true,
}),
nodeResolve(),
terser(),
],
output: {
file: 'experimental-bundled-ui-shell.js',
format: 'esm',
},
},
external: [
'tslib',
'lit',
/^lit\/.*/,
/^carbon-web-components\/.*/,
/^@carbon\/.*/,
],
}));
];

0 comments on commit 69fb75a

Please sign in to comment.