question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Main entry point support

See original GitHub issue

I notice in your example webpack config you have { entry: './src/entry' }, which is a JS file that requires any PureScript modules that you need.

In my case, I just want to call Main.main, so mine looks like this: require('./Main.purs').main(); It seems like it would be cleaner if you could just use { entry: './src/Main.purs' } directly.

I believe the browserify/psc-bundle toolchain does something like this already. Would you consider adding it to purs-loader? I’m fairly new to PureScript, but happy to do the lifting with a bit of direction. (Though maybe #31 would make this irrelevant anyway.)

Issue Analytics

  • State:open
  • Created 8 years ago
  • Reactions:5
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
Pauancommented, Nov 6, 2016

@ethul Hm, actually, I thought about it some more. Webpack supports multiple entry points, so you would really want to be able to specify a different main per entry point. That complicates things a lot.

If you only have a single entry point, you can currently use the following to specify the main:

module: {
  loaders: [
    {
      test: /\.purs$/,
      loader: "purs-loader",
      exclude: /node_modules/,
      query: {
        bundle: true,
        pscBundleArgs: {
          main: "Main"
        },
        src: ["bower_components/purescript-*/src/**/*.purs", "src/**/*.purs"]
      }
    }
  ]
}
1reaction
Pauancommented, Nov 6, 2016

@ethul With psc-bundle, it is not necessary to use unsafePerformEff, instead you simply return an Eff from main, which is idiomatic in PureScript.

I think purs-loader should support a main option, similar to psc-bundle

Read more comments on GitHub >

github_iconTop Results From Across the Web

Strategy: Finding Entry Point At Support And Resistance Level
The Best Crypto Trading Robot: Make Money On Complete Autopilot https://royalqcryptotradingbot.com ..... Over the years, we have built up ...
Read more >
Entry point - Wikipedia
For some operating systems and programming languages, the entry point is in a runtime library, a set of support functions for the language....
Read more >
Investment Entry Point Definition and How to Optimize
For instance, the chart below has a trading range between $22 and 27.5. A high probability entry point for a long trade would...
Read more >
Entry Point - Elements Docs
Support for this new Aspect is planned, but not implemented yet. (SE-0281 @main: Type-Based Program Entry Points, bugs://84619). Projects without Entry Point.
Read more >
Entry Point Wiki - Fandom
Entry Point Wiki is a community site that anyone can contribute to. Discover, share and add your knowledge! ... View full main page ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found