SolidOS/solid-panes

Pane tester cannot compile profile view pane

Closed this issue · 6 comments

 ERROR in ../src/profile/profile.view.ts
    Module build failed (from ../node_modules/babel-loader/lib/index.js):
    SyntaxError: /workspace/solid-panes-fork/src/profile/profile.view.ts: Unexpected token (19:14)
    
      17 | import { PaneDefinition } from 'pane-registry'
      18 | 
    > 19 | const thisPane: PaneDefinition = {
         |               ^
      20 |   global: false,

Steps to reproduce

git clone https://github.com/solid/solid-panes
cd solid-panes
npm install
cd dev

Change the pane in pane/index.ts:

-import sharingPane from '../../src/sharing/sharingPane'
+import sharingPane from '../../src/profile/profile.view'
npx webpack-dev-server

Unexpected token usually means that the TypeScript transpiler is not correctly configured.

TypeScript in general is working fine for the files within dev. But as I understand it, files from parent-level directories (relative to the webpack config) are not transpiled.

I tried to add the dev server to the root webpack.config.js and then it actually works. @michielbdejong any reason why you put a separate config in dev. Could'nt we have all the settings in the root config?

Yes, we could, definitely!
I see your problem now. The way I had originally done it was to put the whole pane into ./dev/pane, so:

cp ../src/profile/* pane/

and then change the pane in pane/index.ts:

import Pane from './profile.view'

I thought about moving my webpack config into the root one but it looked scary, I was afraid that it would affect the main production/development build. If you're able to merge it into there, then that would be great because then indeed we could test panes that reside under src/ without moving them to dev/pane/.

I have a working build using a root config, but I am not sure about how the expected build for production / publishing to npm should look like. Right now it is bloated anyway, see #233

I have a working build using a root config

Cool! Can you put it in a PR?

This is working meanwhile