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

Atom Package? #650

Closed
ChrisTalman opened this issue Jun 17, 2017 · 5 comments
Closed

Atom Package? #650

ChrisTalman opened this issue Jun 17, 2017 · 5 comments

Comments

@ChrisTalman
Copy link

Are there any plans to provide a Svelte Atom package, or any community efforts to do so? In particular, are there any efforts to provide automatic compilation in such a package?

I am aware that the roadmap (#622) mentions long-term support for 'editor plugins'. However, it would be interesting to know whether there are any plans concerning Atom specifically, and whether these include some kind of automatic compilation process. It could be useful for development for an Atom package to detect changes to templates and automatically compile output files to a deployment directory.

It is possible that an issue is not the best forum for this kind of question, although I could not identify a more appropriate forum.

@Rich-Harris
Copy link
Member

Am certainly in favour of this sort of thing existing. No specific plans, for Atom or otherwise. I hadn't really thought about automatic compilation on file changes — I'd imagined that editor integrations would be more focused on linting, autocomplete etc, since in general compilation is best handled in a build step — but no reason in principle that it couldn't.

@PaulBGD
Copy link
Member

PaulBGD commented Jun 17, 2017

Mentioned here #622 (comment) I'm currently looking into the best way to bring svelte to multiple editors.

@ChrisTalman
Copy link
Author

Thanks for the responses. I will follow this topic with interest.

In the meantime, svelte-loader can be combined with the Webpack watch mode to achieve automatic compilation.

@coussej
Copy link

coussej commented Jun 21, 2017

I'm using rollup and NPM scripts to set up this kind of 'compile on change'.

First, setup rollup for svelte.

Then, install watch, parallelshell, and maybe http-server for hosting the files:

npm install watch parallelshell http-server -g

Then in your package.json you can set a script like this (assuming you configured rollup to compile ./src to ./dist):

{
  ...,
  "scripts": {
    "dev": "parallelshell 'watch --interval=1 \"rollup -c\" ./src/' 'http-server ./dist' "
  },
  ...
{

When you run npm run dev in a terminal, it will fire up the http-server (or your own app, depending on your setup) and watch the src directory at the same time, compiling the files (rollup -c) after each change.

Hope this helps :-)

@Rich-Harris
Copy link
Member

Am tidying up the issue tracker — closing this due to inactivity. Note that Rollup has a built-in watcher, you just need to pass -cw (or --config --watch) instead of -c.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants