We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
my js content is:
function testHello() { return "hello" } let myLib = { testHello } module.export = myLib
flutter content is:
await initRuntime(); var res = javascriptRuntime.evaluate(""" testHello(); """).stringResult;
it's works.
but when i build it with webpack,
const path = require('path') module.exports = { entry: ['./src/main.js'], // devtool: 'source-map', mode: 'production', resolve: { extensions: ['.tsx', '.ts', '.js'] }, output: { filename: 'vara-network.min.js', path: path.resolve(__dirname, 'dist'), globalObject: "this", library: 'varaNetwork', libraryTarget: 'umd' } };
build: npx webpack --config webpack.config.js
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.varaNetwork=t():e.varaNetwork=t()}(this,(()=>(()=>{var e={225:(e,t,o)=>{(e=o.nmd(e)).export={testHello:function(){return"hello"}}}},t={};function o(r){var n=t[r];if(void 0!==n)return n.exports;var d=t[r]={id:r,loaded:!1,exports:{}};return e[r](d,d.exports,o),d.loaded=!0,d.exports}return o.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),o(225)})()));
it can not works. and got error:
address is:"ERROR: Can't find variable: testHello \n at global code@"
The text was updated successfully, but these errors were encountered:
Found a solution using: libraryTarget: 'var', globalObject: 'this',
libraryTarget: 'var', globalObject: 'this',
in the webpack config
Sorry, something went wrong.
No branches or pull requests
my js content is:
flutter content is:
it's works.
but when i build it with webpack,
build: npx webpack --config webpack.config.js
it can not works. and got error:
The text was updated successfully, but these errors were encountered: