Skip to content
This repository was archived by the owner on Apr 19, 2021. It is now read-only.
This repository was archived by the owner on Apr 19, 2021. It is now read-only.

Hot reloading (automatic refreshing) from TypeScript files #9

Open
@babichjacob

Description

@babichjacob

From Carlo$#3952 on Discord

My issue is this:

//client.ts
import * as sapper from "@sapper/app";
import { setup } from "fileInSRCNodeModules";

(async () => {
  await setup();
  await sapper.start({
    target: document.querySelector("#sapper")
  });
)();

When I run

npm run dev

I get:

Could not load C:/example/src/node_modules/fileInSRCNodeModules.ts (imported by C:\example\src\client.ts): Debug Failure. False expression: Expected fileName 
to be present in command line

Edit 1:
Creating the file in "/src/someFile.ts" or even "/src/folder/someFile.ts"
And then calling it from "client.ts" as -

import { setup } from "./someFile.ts"

works

am I accidently not allowing "node_modules" access? But "@sapper/app" works

Activity

self-assigned this
on Jul 10, 2020
added
bugSomething isn't working
questionFurther information is requested
on Jul 10, 2020
babichjacob

babichjacob commented on Jul 11, 2020

@babichjacob
OwnerAuthor

Live reload possibly not working
Probably an upstream problem

added
upstreamThis can only be solved by an upstream project's changes
and removed
questionFurther information is requested
on Jul 11, 2020
changed the title [-]Accessing TypeScript files from `src/node_modules/`[/-] [+]TypeScript files in `src/node_modules/`; Hot reloading (automatic refreshing) from TypeScript files[/+] on Jul 11, 2020
babichjacob

babichjacob commented on Jul 11, 2020

@babichjacob
OwnerAuthor

I manually added livereload: import livereload from "rollup-plugin-livereload"; to rollup.config and set it the config to dev && livereload("sapper/dev"),
This allows the hot reload off of any rebuilds - however - since sapper already rebuilds by default on all changes but .ts files - this causes the reload to happen twice on files except .ts
So - Iooked through the sapper cli and you can set the reload to false
I modified the npm run dev to be: "dev": "cross-env ROLLUP_WATCH=true sapper dev --live false",
Now, it rebuilds accordingly

image

removed their assignment
on Jul 22, 2020
added
enhancementNew feature or request
and removed
bugSomething isn't working
on Aug 8, 2020
changed the title [-]TypeScript files in `src/node_modules/`; Hot reloading (automatic refreshing) from TypeScript files[/-] [+]Hot reloading (automatic refreshing) from TypeScript files[/+] on Aug 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestupstreamThis can only be solved by an upstream project's changes

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @babichjacob

        Issue actions

          Hot reloading (automatic refreshing) from TypeScript files · Issue #9 · babichjacob/sapper-typescript-graphql-template