I created a hello.es6.js and I imported it in the index.es6.js, but throw an error in my browser "Uncaught ReferenceError: require is not defined", I built with npm run-script build hello.es6.js to hello.js and it's work and put js/hello.js: {} in .libraries.yml too
and another question, how to use external lib like slick slider in node_modules?
Follow my files:
Hello.e6.js - Throw error in browser - Uncaught ReferenceError: exports is not defined(My files are transpile)
class Hello extends Component {
render() {
return (
<div>hello</div>
);
}
}
export default Hello;
Index.es6.js - Uncaught ReferenceError: require is not defined(My files are transpile)
import Hello from './hello'
name-test .libraries.yml
js/hello.js: {}
Closed: works as designed
2.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.