I am struggling to create a dist folder with webpack.config.js for my sapper svelte project, and yes I know with sapper all you have to do is run the build command for building and export to create the static folder in __ sapper __
But I am trying to run Webpack to build a dist folder just like you do with React, this is my entry:
"entry": {
main: path.join(__dirname, 'src', "client")
}
In sapper that file is:
import * as sapper from '@sapper/app';
export let target = document.querySelector('#sapper')
sapper.start({target})
Which is the equivalent of this in react:
ReactDOM.render(
<Provider store={store}>
<Router history={history}>
<App />
</Router>
</Provider>,
document.getElementById('app')
)
Problem is, when I run Webpack I get a syntax error:
WARNING in ./src/client.js
Module Warning (from ./node_modules/svelte-loader/index.js):
'target' is not defined. Consider adding a <script> block with 'export let target' to declare a prop (3:14)
1: import * as sapper from '@sapper/app';
2: export let target = document.querySelector('#sapper')
3: sapper.start({target});
^