Skip to content

Commit

Permalink
Update rollup to v4
Browse files Browse the repository at this point in the history
and the plugins
  • Loading branch information
tjenkinson committed Nov 22, 2023
1 parent e680e9a commit 8f0190e
Show file tree
Hide file tree
Showing 6 changed files with 362 additions and 65 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ jobs:

- name: install
run: |
npx -y npm-ci-please@^1.1.1
npm ci
env:
CI: true

Expand Down Expand Up @@ -159,7 +159,7 @@ jobs:

- name: install
run: |
npx -y npm-ci-please@^1.1.1
npm ci
env:
CI: true

Expand Down Expand Up @@ -203,7 +203,7 @@ jobs:

- name: install
run: |
npx -y npm-ci-please@^1.1.1
npm ci
env:
CI: true

Expand Down Expand Up @@ -314,7 +314,7 @@ jobs:

- name: install
run: |
npx -y npm-ci-please@^1.1.1
npm ci
env:
CI: true

Expand Down Expand Up @@ -386,7 +386,7 @@ jobs:

- name: install
run: |
npx -y npm-ci-please@^1.1.1
npm ci
env:
CI: true

Expand Down Expand Up @@ -458,7 +458,7 @@ jobs:

- name: install
run: |
npx -y npm-ci-please@^1.1.1
npm ci
env:
CI: true

Expand Down
30 changes: 16 additions & 14 deletions build-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,19 @@ const buildConstants = (type, additional = {}) => ({
},
});

const buildOnLog = ({ allowCircularDeps } = {}) => {
return (level, log, handler) => {
if (allowCircularDeps && log.code === 'CIRCULAR_DEPENDENCY') return;

if (level === 'warn') {
// treat warnings as errors
handler('error', log);
} else {
handler(level, log);
}
};
};

const workerFnBanner = '(function __HLS_WORKER_BUNDLE__(__IN_WORKER__){';
const workerFnFooter = '})(false);';

Expand Down Expand Up @@ -255,12 +268,7 @@ const buildRollupConfig = ({

return {
input,
onwarn: (e) => {
if (allowCircularDeps && e.code === 'CIRCULAR_DEPENDENCY') return;

// treat warnings as errors
throw new Error(e);
},
onLog: buildOnLog({ allowCircularDeps }),
output: {
name: 'Hls',
file: outputFile
Expand Down Expand Up @@ -331,10 +339,7 @@ const configs = Object.entries({
}),
worker: {
input: './src/demux/transmuxer-worker.ts',
onwarn: (e) => {
// treat warnings as errors
throw new Error(e);
},
onLog: buildOnLog(),
output: {
name: 'HlsWorker',
file: './dist/hls.worker.js',
Expand All @@ -355,10 +360,7 @@ const configs = Object.entries({
},
demo: {
input: './demo/main.js',
onwarn: (e) => {
// treat warnings as errors
throw new Error(e);
},
onLog: buildOnLog(),
output: {
name: 'HlsDemo',
file: './dist/hls-demo.js',
Expand Down
Loading

0 comments on commit 8f0190e

Please sign in to comment.