Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup 4 #5886

Merged
merged 3 commits into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading