-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Implement rollup build * Fix unit tests * Fix rollup source maps
- Loading branch information
Showing
11 changed files
with
93 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
const typescript = require("@rollup/plugin-typescript"); | ||
const nodeResolve = require("@rollup/plugin-node-resolve"); | ||
const commonjs = require("@rollup/plugin-commonjs"); | ||
const replace = require("@rollup/plugin-replace"); | ||
const bannerPlugin = require("rollup-plugin-license"); | ||
|
||
const path = require("path"); | ||
const VERSION = require("./package.json").version; | ||
|
||
const banner = [ | ||
"surveyjs - SurveyJS PDF library v" + VERSION, | ||
"Copyright (c) 2015-" + new Date().getFullYear() + " Devsoft Baltic OÜ - http://surveyjs.io/", | ||
"License: MIT (http://www.opensource.org/licenses/mit-license.php)" | ||
].join("\n"); | ||
const input = { "survey.pdf": path.resolve(__dirname, "./src/entries/pdf.ts") }; | ||
module.exports = (options) => { | ||
options = options ?? {}; | ||
if(!options.tsconfig) { | ||
options.tsconfig = path.resolve(__dirname, "./tsconfig.fesm.json"); | ||
} | ||
if(!options.dir) { | ||
options.dir = path.resolve(__dirname, "./build/fesm"); | ||
} | ||
return { | ||
input, | ||
context: "this", | ||
|
||
plugins: [ | ||
nodeResolve(), | ||
commonjs(), | ||
typescript({ inlineSources: true, sourceMap: true, tsconfig: options.tsconfig, compilerOptions: { | ||
declaration: false, | ||
declarationDir: null | ||
} }), | ||
replace({ | ||
preventAssignment: false, | ||
values: { | ||
"process.env.RELEASE_DATE": JSON.stringify(new Date().toISOString().slice(0, 10)), | ||
"process.env.VERSION": JSON.stringify(VERSION), | ||
} | ||
}), | ||
bannerPlugin({ | ||
banner: { | ||
content: banner, | ||
commentStyle: "ignored", | ||
} | ||
}) | ||
], | ||
external: [ | ||
"jspdf", | ||
"survey-core", | ||
], | ||
output: [ | ||
{ | ||
dir: options.dir, | ||
format: "esm", | ||
exports: "named", | ||
sourcemap: true, | ||
}, | ||
], | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
const defaultConfig = require("./rollup.config"); | ||
const path = require("path"); | ||
const fs = require("fs"); | ||
const input = { | ||
"survey.pdf.fonts": path.resolve(__dirname, "./src/fonts.ts"), | ||
}; | ||
|
||
module.exports = () => { | ||
const config = defaultConfig(); | ||
config.input = input; | ||
config.external = ["survey-pdf"]; | ||
return config; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.