1.0.2 • Published 4 years ago

launch-loader v1.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

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
  }
}
1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago