Skip to content
New issue

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

Enable sourcemaps and debugger #330

Merged
merged 2 commits into from
Mar 17, 2021
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
3 changes: 2 additions & 1 deletion Feliz.Template/Content/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -202,4 +202,5 @@ out
.fable
.vs
.ionide
*.fs.js
*.fs.js
*.fs.js.map
26 changes: 26 additions & 0 deletions Feliz.Template/Content/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Debug firefox",
"type": "firefox",
"request": "launch",
"reAttach": true,
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}",
"skipFiles": [
"**/node_modules/**"
]
},
{
"name": "Debug chrome",
"type": "chrome",
"request": "launch",
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}"
}
]
}
34 changes: 34 additions & 0 deletions Feliz.Template/Content/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Feliz.Template/Content/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"private": true,
"scripts": {
"prestart": "dotnet tool restore",
"start": "dotnet fable watch ./src --run webpack serve --mode=development",
"start": "dotnet fable watch ./src -s --run webpack serve --mode=development",
"prebuild": "dotnet tool restore",
"build": "dotnet fable ./src && webpack --mode=production",
"test:live": "dotnet fable watch tests --run webpack serve --mode=development --config ./webpack.tests.js",
Expand Down Expand Up @@ -36,6 +36,7 @@
"react-refresh": "^0.9.0",
"sass": "^1.32.4",
"sass-loader": "^10.1.1",
"source-map-loader": "^2.0.1",
"style-loader": "^2.0.0",
"terser": "^4.8.0",
"webpack": "^5.14.0",
Expand Down
6 changes: 6 additions & 0 deletions Feliz.Template/Content/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,17 @@ module.exports = (env, argv) => {
hot: true,
inline: true
},
// - source-map-loader: Allows Fable generated Source Maps to be hit https://github.com/MangelMaxime/fulma-demo/pull/43#issuecomment-756556346
// - babel-loader: transforms JS to old syntax (compatible with old browsers)
// - sass-loaders: transforms SASS/SCSS into JS
// - file-loader: Moves files referenced in the code (fonts, images) into output folder
module: {
rules: [
{
test: /\.js$/,
enforce: "pre",
use: ["source-map-loader"],
},
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
Expand Down