GithubHelp home page GithubHelp logo

pragmas about ratpack HOT 9 OPEN

threepointone avatar threepointone commented on August 20, 2024 6
pragmas

from ratpack.

Comments (9)

threepointone avatar threepointone commented on August 20, 2024 1

coffeescript should work with the rules support rules: [{ files: '*.coffee', ... }]

upcoming plugin support should let you hook into webpack's plugin system (including adding npm-install-webpack-plugin by hand, if need be). In general, this + the above should cover 99% of stuff.

I can render the ejected config with stuff pulled out of pragmas, should be ok.

I want to think deeper on native autoinstall though. scary :)

Ideally, this whole thing would be a webpack plugin so it's not so coupled with ratpack, and would work with other tooling. I'm not too familiar with building webpack plugins though, so don't know where to start.

from ratpack.

threepointone avatar threepointone commented on August 20, 2024 1

I'm using json5 for parsing, which allows for unquoted keys and inline comments, much like babelrc parsing. All good.

from ratpack.

threepointone avatar threepointone commented on August 20, 2024

webpack-dev-server doesn't support changing config once it's started, so I'll have to do a file watcher on the entry file, and restart the server if any of the pragmas change. any alternatives?

from ratpack.

threepointone avatar threepointone commented on August 20, 2024

can this be made into a webpack plugin? what does that look like?

from ratpack.

threepointone avatar threepointone commented on August 20, 2024

another option would be to have it as a json5 object

/* @ratpack
{
  devtool: 'eval',
  ...
} */

[edit: changed above to json from previous syntax]

from ratpack.

threepointone avatar threepointone commented on August 20, 2024

I got file watching to work, so it restarts webpack and the dev server whenever the pragmas change. so cool! [pats self on back]

from ratpack.

siddharthkp avatar siddharthkp commented on August 20, 2024

+1 for custom babel config!

from ratpack.

siddharthkp avatar siddharthkp commented on August 20, 2024

Can't help but think of a plugin system - things like auto install and coffeescript support

npm install ratpack-plugin-coffeescript?

Nuance: customizations can make ejecting more difficult

from ratpack.

rreusser avatar rreusser commented on August 20, 2024

Tiny nitpick: Is that actually JSON? You've used unquoted keys. Do the keys need to be double-quoted for it to be considered actual JSON? In particular I ran into a weird error once in which valid JSON might not even be valid JavaScript, so just wanted to point out there can be weird and frustrating corner cases hiding in the details here. package.json parsing tends to be similarly (frustratingly?) strict.

Otherwise love it! 😄

from ratpack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.