Comments (5)
Thanks for confirming.
I am closing this issue, because the problem is not with Fable but the weback configuration.
from fable.
Hello,
This is normal that you can't access the validate
function.
The function is only available from inside the Program.fs.js
or your bundle.js
in your case. You need to look on Webpack documentation how to expose a bundle as a library.
I think you want to look for the output.library.type
options in webpack.
Depending on the option you should be able to use it via a variable, a globally available API or using import statement.
If you are new to JavaScript, you should also look at ESM modules as this is the type of JavaScript that Fable produce.
from fable.
Ok, thanks.
I've tried this and I can't get it to work.
Are there examples of this?
from fable.
I think I now have it working....
once I confirm, I shall update here with the how.
from fable.
Confirmed, I have this working:
webpack.config.js:
var path = require("path");
module.exports = {
mode: "development",
entry: "./src/Program.fs.js",
optimization: {
minimize: false
},
output: {
path: path.resolve(__dirname, './src/public'),
filename: 'Program.fs.js',
libraryTarget: 'var',
library: 'Program'
},
devServer: {
static: "./public",
port: 8080,
}
}
package.json:
{
"private": true,
"scripts": {
"postinstall": "dotnet tool restore",
"start": "fable watch src --run webpack serve"
},
"dependencies": {
"webpack": "^5.75.0",
"webpack-cli": "^5.0.0",
"webpack-dev-server": "^4.11.1"
}
}
I'll update my repo shortly too.
from fable.
Related Issues (20)
- Implement rest of Result module HOT 2
- Change Fantomas max_line_length and reformat HOT 1
- Allows to redirect a `Project reference` or `NuGet package` to be consumed via local folder or NPM packages instead of inlining it inside of the main project output HOT 13
- Rust tests fail in dev container locally HOT 10
- New `logger` doesn't display the same information as before when using `--verbose`
- Explore why Python CI fails from time to time HOT 2
- v4.8.0+ fails to compile Feliz.MaterialUI or/and Feliz.MuiX.DatePickers HOT 1
- Imports for FSX files have wrong extension. HOT 2
- Build fails after upgrading to fable tool to 4.12.0 HOT 6
- Reset Color in CLI
- Should StringBuilder.Chars(int) work ?
- string.ToCharArray(start,length) returns wrong result.
- Changelog simplification HOT 4
- [Python] Boxing bytes looses type information HOT 3
- We should avoid forwarding method to `LibCall` without checking the name
- [Python] KeyValuePair object in Array is handled as only key(?) HOT 2
- Import followed by a comments should be moved to the top of the generated file HOT 5
- Local Function Name Clashes with Global JavaScript Functions Leading to Incorrect Behavior HOT 1
- `--test:MSBuildCracker` not working against Glutinum project HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fable.