Support a script tag only for the full build
This commit is contained in:
@@ -8,7 +8,7 @@ export default {
|
|||||||
name: 'ol',
|
name: 'ol',
|
||||||
format: 'umd',
|
format: 'umd',
|
||||||
exports: 'default',
|
exports: 'default',
|
||||||
file: 'build/full/ol.cjs',
|
file: 'build/full/ol.js',
|
||||||
globals: {
|
globals: {
|
||||||
geotiff: 'geotiff',
|
geotiff: 'geotiff',
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -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',
|
|
||||||
},
|
|
||||||
};
|
|
||||||
@@ -5,8 +5,8 @@ import {fileURLToPath} from 'url';
|
|||||||
|
|
||||||
const baseDir = dirname(fileURLToPath(import.meta.url));
|
const baseDir = dirname(fileURLToPath(import.meta.url));
|
||||||
const buildDir = path.resolve(baseDir, '../build/ol');
|
const buildDir = path.resolve(baseDir, '../build/ol');
|
||||||
const fullBuildSource = path.resolve(baseDir, '../build/full/ol.cjs');
|
const fullBuildSource = path.resolve(baseDir, '../build/full/ol.js');
|
||||||
const fullBuildDest = path.join(buildDir, 'dist/index.cjs');
|
const fullBuildDest = path.join(buildDir, 'dist/index.js');
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
const pkg = await fse.readJSON(path.resolve(baseDir, '../package.json'));
|
const pkg = await fse.readJSON(path.resolve(baseDir, '../package.json'));
|
||||||
|
|||||||
Reference in New Issue
Block a user