1.0.2 • Published 4 years ago
launch-loader v1.0.2
launch-loader
How It Works
You can input a React
component as entry page by webpack
.
export default class Page extends Component {
render() { return <p /> }
}
// or
export class Page extends Component {
render() { return <p /> }
}
launch-loader
will try to find the first export name and attach to global namespace, then append launch code.
const View = window.epii.entry = Page;
const ReactDOM = require('react-dom');
const root = document.getElementById('app');
ReactDOM.render(React.createElement(View), root);
Usage
npm install --save launch-loader@latest
{
loader: 'launch-loader',
options: {
holder: 'app', // div#app
global: 'epii', // window.epii.entry = app class
}
}