Skip to content
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
5 changes: 3 additions & 2 deletions packages/maptalks-gl/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
"@rollup/plugin-terser": "0.4.4",
"rimraf": "^6.0.1",
"rollup": "^4.17.2",
"rollup-plugin-sourcemaps": "0.6.3"
"rollup-plugin-sourcemaps": "0.6.3",
"rollup-plugin-copy": "^3.5.0"
},
"dependencies": {
"@maptalks/3dtiles": "workspace:*",
Expand All @@ -52,4 +53,4 @@
"@maptalks/vt": "workspace:*",
"maptalks": "workspace:*"
}
}
}
7 changes: 7 additions & 0 deletions packages/maptalks-gl/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const commonjs = require('@rollup/plugin-commonjs');
const pkg = require('./package.json');
const terser = require('@rollup/plugin-terser');
const sourcemaps = require('rollup-plugin-sourcemaps');
const copy = require('rollup-plugin-copy');

const outputFile = pkg.main;

Expand All @@ -15,6 +16,12 @@ module.exports = [
{
input: './index.js',
plugins: [
copy({
targets: [
{ src: '../maptalks/assets/*', dest: 'dist' },
{ src: '../maptalks/assets/maptalks.css', dest: 'dist/', rename: 'maptalks-gl.css' },
]
}),
nodeResolve({
module: true,
// jsnext : true,
Expand Down
11 changes: 6 additions & 5 deletions packages/maptalks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"docs:english": "npx tsc --project docs/typedoc-plugins && npx typedoc --lang english",
"tsc": "tsc --noEmit",
"build-dts": "dts-bundle-generator src/index.ts -o dist/maptalks.d.ts --no-banner --no-check",
"build": "npm run clean && npm run lint && npm run tsc && rollup -c && npm run build-styles && npm run build-dts",
"build": "npm run clean && npm run lint && npm run tsc && rollup -c && npm run build-dts",
"build-test": "rollup -c --environment BUILD:test",
"build-styles": "cp -rf assets dist || xcopy assets dist /e /y",
"dev": "rollup --environment BUILD:dev -c -w",
Expand Down Expand Up @@ -65,13 +65,13 @@
"simplify-js": "^1.2.1"
},
"devDependencies": {
"@babel/preset-env": "^7.24.1",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-terser": "0.4.4",
"@rollup/plugin-typescript": "^11.1.6",
"@babel/preset-env": "^7.24.1",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-json": "^6.1.0",
"@types/node": "^20.11.30",
"@types/offscreencanvas": "^2019.7.3",
"dts-bundle-generator": "^9.5.1",
Expand All @@ -93,6 +93,7 @@
"rimraf": "^6.0.1",
"rollup": "^4.17.2",
"rollup-plugin-dts": "^6.1.0",
"rollup-plugin-copy": "^3.5.0",
"sinon": "^3.2.1",
"tslib": "^2.6.2",
"typedoc": "^0.27.5",
Expand All @@ -104,4 +105,4 @@
"@rollup/rollup-darwin-x64": "^4.13.0",
"@rollup/rollup-linux-x64-gnu": "^4.13.0"
}
}
}
10 changes: 9 additions & 1 deletion packages/maptalks/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@ const commonjs = require('@rollup/plugin-commonjs'),
typescript = require('@rollup/plugin-typescript'),
terser = require('@rollup/plugin-terser');
const pkg = require('./package.json');
// eslint-disable-next-line no-unused-vars
const { dts } = require("rollup-plugin-dts");
const copy = require('rollup-plugin-copy');

const testing = process.env.BUILD === 'test';
const dev = process.env.BUILD === 'dev';

const isDebug = testing || dev;
// eslint-disable-next-line no-unused-vars
const plugins = testing ?
[
// ['istanbul', {
Expand All @@ -26,6 +29,11 @@ const banner = `/*!\n * ${pkg.name} v${pkg.version}\n * LICENSE : ${pkg.license}
const outro = `typeof console !== 'undefined' && console.log && console.log('${pkg.name} v${pkg.version}');`;

const rollupPlugins = [
copy({
targets: [
{ src: 'assets/*', dest: 'dist' },
]
}),
json(),
resolve({
module: true,
Expand All @@ -34,7 +42,7 @@ const rollupPlugins = [
}),
commonjs(),
typescript({
sourceMap: true
sourceMap: true
}),
babel({
extensions: [".ts"],
Expand Down
Loading