From 8a9bf4ac7a1fbe98b57d15d506ebeaf1e8f15eec Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Mon, 29 Aug 2022 12:17:10 -0600 Subject: [PATCH] Support a script tag only for the full build --- config/rollup-full-build.js | 2 +- config/webpack-config-legacy-build.mjs | 37 -------------------------- tasks/prepare-package.js | 4 +-- 3 files changed, 3 insertions(+), 40 deletions(-) delete mode 100644 config/webpack-config-legacy-build.mjs diff --git a/config/rollup-full-build.js b/config/rollup-full-build.js index 3762323b2f..df8d807e10 100644 --- a/config/rollup-full-build.js +++ b/config/rollup-full-build.js @@ -8,7 +8,7 @@ export default { name: 'ol', format: 'umd', exports: 'default', - file: 'build/full/ol.cjs', + file: 'build/full/ol.js', globals: { geotiff: 'geotiff', }, diff --git a/config/webpack-config-legacy-build.mjs b/config/webpack-config-legacy-build.mjs deleted file mode 100644 index 87e23f58a4..0000000000 --- a/config/webpack-config-legacy-build.mjs +++ /dev/null @@ -1,37 +0,0 @@ -import TerserPlugin from 'terser-webpack-plugin'; -import path from 'path'; - -export default { - entry: './build/index.js', - devtool: 'source-map', - mode: 'production', - target: ['browserslist'], - resolve: { - fallback: { - fs: false, - http: false, - https: false, - }, - alias: { - ol: path.resolve('./build/ol'), - }, - }, - optimization: { - minimizer: [ - new TerserPlugin({ - terserOptions: { - // Mangle private members convention with underscore suffix - mangle: {properties: {regex: /_$/}}, - }, - }), - ], - }, - output: { - path: path.resolve('./build/legacy'), - publicPath: 'auto', - filename: 'ol.js', - library: 'ol', - libraryTarget: 'umd', - libraryExport: 'default', - }, -}; diff --git a/tasks/prepare-package.js b/tasks/prepare-package.js index cf2f03a7e0..d5677fdd8b 100644 --- a/tasks/prepare-package.js +++ b/tasks/prepare-package.js @@ -5,8 +5,8 @@ import {fileURLToPath} from 'url'; const baseDir = dirname(fileURLToPath(import.meta.url)); const buildDir = path.resolve(baseDir, '../build/ol'); -const fullBuildSource = path.resolve(baseDir, '../build/full/ol.cjs'); -const fullBuildDest = path.join(buildDir, 'dist/index.cjs'); +const fullBuildSource = path.resolve(baseDir, '../build/full/ol.js'); +const fullBuildDest = path.join(buildDir, 'dist/index.js'); async function main() { const pkg = await fse.readJSON(path.resolve(baseDir, '../package.json'));