Include the full build in the ol package
This commit is contained in:
4
.github/workflows/test.yml
vendored
4
.github/workflows/test.yml
vendored
@@ -103,8 +103,8 @@ jobs:
|
||||
- name: Build the Package
|
||||
run: npm run build-package
|
||||
|
||||
- name: Generate the Legacy Build
|
||||
run: "npm run build-legacy && npx eslint --rule 'import/no-duplicates: off' --fix build/index.js"
|
||||
- name: Generate the Full Build
|
||||
run: "npm run build-full"
|
||||
|
||||
rendering:
|
||||
name: Rendering
|
||||
|
||||
20
config/rollup-full-build.js
Normal file
20
config/rollup-full-build.js
Normal file
@@ -0,0 +1,20 @@
|
||||
import commonjs from '@rollup/plugin-commonjs';
|
||||
import resolve from '@rollup/plugin-node-resolve';
|
||||
|
||||
export default {
|
||||
input: 'build/index.js',
|
||||
output: {
|
||||
name: 'ol',
|
||||
format: 'umd',
|
||||
exports: 'default',
|
||||
file: 'build/full/ol.js',
|
||||
globals: {
|
||||
geotiff: 'geotiff',
|
||||
},
|
||||
},
|
||||
plugins: [
|
||||
resolve({moduleDirectories: ['build', 'node_modules']}),
|
||||
commonjs(),
|
||||
],
|
||||
external: ['geotiff'],
|
||||
};
|
||||
@@ -20,9 +20,9 @@
|
||||
"start": "npm run serve-examples",
|
||||
"serve-examples": "webpack serve --config examples/webpack/config.mjs --mode development",
|
||||
"build-examples": "shx rm -rf build/examples && webpack --config examples/webpack/config.mjs --mode production",
|
||||
"build-package": "npm run transpile && npm run copy-css && npm run generate-types && node tasks/prepare-package.js",
|
||||
"build-index": "shx rm -f build/index.js && npm run build-package && node tasks/generate-index.js",
|
||||
"build-legacy": "shx rm -rf build/legacy && npm run build-index && webpack --config config/webpack-config-legacy-build.mjs && cleancss --source-map src/ol/ol.css -o build/legacy/ol.css",
|
||||
"build-package": "npm run build-full && npm run copy-css && npm run generate-types && node tasks/prepare-package.js",
|
||||
"build-index": "shx rm -f build/index.js && npm run transpile && node tasks/generate-index.js",
|
||||
"build-full": "shx rm -rf build/full && npm run build-index && npx rollup --config config/rollup-full-build.js",
|
||||
"copy-css": "shx cp src/ol/ol.css build/ol/ol.css",
|
||||
"generate-types": "tsc --project config/tsconfig-build.json --declaration --declarationMap --emitDeclarationOnly --outdir build/ol",
|
||||
"transpile": "shx rm -rf build/ol && shx mkdir -p build/ol && shx cp -rf src/ol build && node tasks/serialize-workers.cjs",
|
||||
|
||||
@@ -71,9 +71,9 @@ echo "Building API docs for ${version}"
|
||||
npm run apidoc
|
||||
mv build/apidoc ${build}/en/${version}/
|
||||
|
||||
echo "Building the legacy build for ${version}"
|
||||
npm run build-legacy
|
||||
mv build/legacy ${build}/en/${version}/
|
||||
echo "Building the package ${version}"
|
||||
npm run build-package
|
||||
mv build/ol ${build}/en/${version}/
|
||||
|
||||
if [[ "${latest}" == "${version}" ]] ; then
|
||||
echo "Copying to en/latest"
|
||||
@@ -84,7 +84,7 @@ if [[ "${latest}" == "${version}" ]] ; then
|
||||
zip -r ${OLDPWD}/build/${version}-site.zip . -x "en/${version}/*"
|
||||
popd
|
||||
|
||||
pushd ${build}/en/${version}/legacy
|
||||
zip -r ${OLDPWD}/build/${version}-legacy.zip .
|
||||
pushd ${build}/en/${version}/ol
|
||||
zip -r ${OLDPWD}/build/${version}-package.zip .
|
||||
popd
|
||||
fi
|
||||
|
||||
@@ -5,6 +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.js');
|
||||
const fullBuildDest = path.join(buildDir, 'dist/index.js');
|
||||
|
||||
async function main() {
|
||||
const pkg = await fse.readJSON(path.resolve(baseDir, '../package.json'));
|
||||
@@ -37,6 +39,9 @@ async function main() {
|
||||
path.resolve(baseDir, '../LICENSE.md'),
|
||||
path.join(buildDir, 'LICENSE.md')
|
||||
);
|
||||
|
||||
await fse.ensureDir(dirname(fullBuildDest));
|
||||
await fse.copyFile(fullBuildSource, fullBuildDest);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user