Closed thomas-romuald closed 3 months ago
@KaiVolland could you take a look at that, as you are way more familiar with the whole bundling thing?
Apologies for not having a look at this. :worried: As this issue is almost four years old and i like to clean up some issues. I'll close this. If this is still an issue and you not just thrown away the geostyler please let us know @thomas-romuald .
Bug
Describe the bug We try using geostyler-sld-parser on a VueJS application. Code on local machine works well using vue-cli-service serve (based on webpack-dev-server).
Production code is bundled using Rollup.js we got a warning during build due to a circular dependencies in xmlbuilder dependencies which must be imported by geostyler-sld-parser. Once deployed code failed Uncaught TypeError: Cannot read property 'prototype' of undefined" on the xml paser part.
To Reproduce Steps to reproduce the behavior:
const postcss = require("rollup-plugin-postcss"); const ComponentVue = [ "./src/lib/modules/msec-visualisation-block/msec-visualisation-block.vue",
// Module below contains : // import SLDParser from "geostyler-sld-parser"; // import OpenLayersParser from "geostyler-openlayers-parser"; "./src/lib/modules/rrp-visualisation-block/rrp-visualisation-block.vue" ];
const confFile = ComponentVue.map(componentpath => { const confFileName = componentpath.split("/").reverse()[0]; return { input: componentpath, output: { file: "modules/" + confFileName + ".esm.js", format: "esm" }, moduleContext: { 'node_modules/sax/lib/sax.js': 'window' }, external: ["vue-i18n","vue"], plugins: [ alias({ entries: { ['@']: __dirname + '/src' } }), nodePolyfills(), commonjs({ include: /node_modules/ }), resolve(), importResolver({ extensions: [".js", ".vue"] }), postcss(), json(), i18n(), vue({ customBlocks: ["i18n"] }) ] }; }); export default confFile;