Missing loader for example code
Opened this issue · 1 comments
TrevorBurnham commented
This repo includes a piece of example code, assets/deck.example
, and the tutorial provides instructions for including it in the presentation by adding the code
const code = {
deckSample: require('../assets/deck.example')
};
and the slide
<Slide>
<ComponentPlayground code={code.deckSample} theme={dark} />
</Slide>
However, doing so yields an error:
ERROR in ./assets/deck.example 1:0
Module parse failed: 'return' outside of function (1:0)
You may need an appropriate loader to handle this file type.
> return (
| <Deck transition={['zoom','slide']} transitionDuration={800}>
| <Slide bgColor="primary">
@ ./presentation/index.js 41:14-47
@ ./index.js
@ multi @babel/polyfill webpack-hot-middleware/client react-hot-loader/patch ./index
I was able to get the example code displayed by updating the Webpack config to use the raw loader for .example
files:
{
test: /\.example$/i,
use: 'raw-loader',
},
leonidlebedev commented
Same problem