From f99a5ceab43a9893b6b9e9335871af796af11edd Mon Sep 17 00:00:00 2001 From: Maxim Schuwalow Date: Mon, 6 May 2024 13:56:53 +0200 Subject: [PATCH] Adjust config --- .browserslistrc | 6 -- .circleci/config.yml | 12 +-- rollup/dist.config.js | 168 ++++++++++++++++---------------- rollup/test-resources.config.js | 2 +- 4 files changed, 89 insertions(+), 99 deletions(-) delete mode 100644 .browserslistrc diff --git a/.browserslistrc b/.browserslistrc deleted file mode 100644 index 94a3ffba..00000000 --- a/.browserslistrc +++ /dev/null @@ -1,6 +0,0 @@ -# https://github.com/browserslist/browserslist#readme -safari 10 -chrome 45 -firefox 52 -not dead -> 0.2% diff --git a/.circleci/config.yml b/.circleci/config.yml index df3f022b..014d2420 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -57,13 +57,10 @@ references: npm_install: &npm_install run: - name: Npm install - command: npm install - - npm_install_additional_docker_deps: &npm_install_additional_docker_deps - run: - name: Npm install additional deps - command: npm install --no-save @rollup/rollup-linux-x64-gnu + name: Install dependencies + command: | + npm install + npm install --no-save @rollup/rollup-linux-x64-gnu host_setup: &host_setup run: @@ -105,7 +102,6 @@ jobs: - node/install: node-version: << pipeline.parameters.node_version >> - *npm_install - - *npm_install_additional_docker_deps - *save_cache - run: name: Run unit tests diff --git a/rollup/dist.config.js b/rollup/dist.config.js index 900039ac..df37eab0 100644 --- a/rollup/dist.config.js +++ b/rollup/dist.config.js @@ -11,95 +11,95 @@ const OUTPUT_DIR = './dist' const DECLARATION_DIR = `${OUTPUT_DIR}/dts` const prebid = { - input: "./src/index.ts", - tsOutput: `${OUTPUT_DIR}/prebid.ts.mjs`, - babelOutput: `${OUTPUT_DIR}/prebid.babel.mjs`, - output: `${OUTPUT_DIR}/prebid.cjs` + input: "./src/index.ts", + tsOutput: `${OUTPUT_DIR}/prebid.ts.mjs`, + babelOutput: `${OUTPUT_DIR}/prebid.babel.mjs`, + output: `${OUTPUT_DIR}/prebid.cjs` } export default [ - { - input: ['./src/index.ts', './src/internal.ts'], - output: [ - { - dir: OUTPUT_DIR, - entryFileNames: '[name].cjs', - chunkFileNames: '[name]-[hash].cjs', - format: 'cjs', - sourcemap: false - }, - { - dir: OUTPUT_DIR, - entryFileNames: '[name].mjs', - chunkFileNames: '[name]-[hash].mjs', - format: 'es', - sourcemap: false - } - ], - plugins: [ - cleaner({ targets: [OUTPUT_DIR] }), - ts({ compilerOptions: { declaration: true, declarationDir: DECLARATION_DIR } }), - strip() - ], - external: [ - 'live-connect-common', - 'tiny-hashes' - ] + { + input: ['./src/index.ts', './src/internal.ts'], + output: [ + { + dir: OUTPUT_DIR, + entryFileNames: '[name].cjs', + chunkFileNames: '[name]-[hash].cjs', + format: 'cjs', + sourcemap: false + }, + { + dir: OUTPUT_DIR, + entryFileNames: '[name].mjs', + chunkFileNames: '[name]-[hash].mjs', + format: 'es', + sourcemap: false + } + ], + plugins: [ + cleaner({ targets: [OUTPUT_DIR] }), + ts({ compilerOptions: { declaration: true, declarationDir: DECLARATION_DIR } }), + strip() + ], + external: [ + 'live-connect-common', + 'tiny-hashes' + ] + }, + { + input: { + index: `${DECLARATION_DIR}/src/index.d.ts`, + internal: `${DECLARATION_DIR}/src/internal.d.ts` }, - { - input: { - index: `${DECLARATION_DIR}/src/index.d.ts`, - internal: `${DECLARATION_DIR}/src/internal.d.ts` - }, - output: [{ dir: OUTPUT_DIR, format: 'es' }], - plugins: [dts(), del({ targets: DECLARATION_DIR, hook: 'buildEnd' })], + output: [{ dir: OUTPUT_DIR, format: 'es' }], + plugins: [dts(), del({ targets: DECLARATION_DIR, hook: 'buildEnd' })], + }, + // + // prebid build + // + { + input: prebid.input, + output: { + file: prebid.tsOutput, + format: 'esm', + sourcemap: false }, - // - // prebid build - // - { - input: prebid.input, - output: { - file: prebid.tsOutput, - format: 'esm', - sourcemap: false - }, - plugins: [ - commonJs({ sourceMap: false }), - resolve(), - ts(), - ] + plugins: [ + commonJs({ sourceMap: false }), + resolve(), + ts(), + ] + }, + // transpile with babel + { + input: prebid.tsOutput, + output: { + file: prebid.babelOutput, + format: 'esm', + sourcemap: false }, - // transpile with babel - { - input: prebid.tsOutput, - output: { - file: prebid.babelOutput, - format: 'esm', - sourcemap: false - }, - plugins: [ - babel({ babelHelpers: 'runtime', configFile: './rollup/babel-prebid.json' }), - del({ targets: prebid.tsOutput, hook: 'buildEnd' }) - ], - external: [ - /@babel\/runtime-corejs3/, - /core-js-pure/ - ] - }, - // minify and bundle - { - input: prebid.babelOutput, - output: { - file: prebid.output, - format: 'cjs', - sourcemap: false - }, - plugins: [ - commonJs({ sourceMap: false }), - resolve(), - strip(), - del({ targets: prebid.babelOutput, hook: 'buildEnd' }) - ] + plugins: [ + babel({ babelHelpers: 'runtime', configFile: './rollup/babel-prebid.json' }), + del({ targets: prebid.tsOutput, hook: 'buildEnd' }) + ], + external: [ + /@babel\/runtime-corejs3/, + /core-js-pure/ + ] + }, + // minify and bundle + { + input: prebid.babelOutput, + output: { + file: prebid.output, + format: 'cjs', + sourcemap: false }, + plugins: [ + commonJs({ sourceMap: false }), + resolve(), + strip(), + del({ targets: prebid.babelOutput, hook: 'buildEnd' }) + ] + }, ] diff --git a/rollup/test-resources.config.js b/rollup/test-resources.config.js index 5a3aaf6e..49087fdf 100644 --- a/rollup/test-resources.config.js +++ b/rollup/test-resources.config.js @@ -28,7 +28,7 @@ export default [ sourcemap: false }, plugins: [ - cleaner({targets: [OUTPUT_DIR]}), + cleaner({ targets: [OUTPUT_DIR] }), replace({ preventAssignment: true, LC_VERSION: JSON.stringify(`${packageJson.versionPrefix}${packageJson.version}`)