Skip to content

Instantly share code, notes, and snippets.

@matthewp
Created November 15, 2017 19:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matthewp/885153da3264bdaa1ecf028ca1c4cbf4 to your computer and use it in GitHub Desktop.
Save matthewp/885153da3264bdaa1ecf028ca1c4cbf4 to your computer and use it in GitHub Desktop.
multi-main example app
package-lock.json
node_modules/
dist/

Multi-main example app

To use this app, first install:

npm install

And then build:

npm run build
var stealTools = require('steal-tools');
stealTools.build({
main: ['app/home', 'app/login']
});
<!doctype html>
<html lang="en">
<title>Home page</title>
<main></main>
<script src="./dist/steal.production.js" main="app/home"></script>
let main = document.querySelector('main');
main.innerHTML = `
<h1>Home page</h1>
`;
<!doctype html>
<html lang="en">
<title>Login</title>
<main></main>
<script src="./dist/steal.production.js" main="app/login"></script>
let main = document.querySelector('main');
main.innerHTML = `
<h1>Login</h1>
`;
{
"name": "app",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"build": "node build.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"steal": "^1.6.0",
"steal-tools": "^1.9.2"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment