Thanks @Sujan12 and @lucasbasquerotto
After including the entire @ionic/core folder in my static website folder, the pages with ion components load properly. So lesson learnt is that “ionic.js” depends on about another 135 js files under @ionic/core/dist/ionc .
For anyone trying to build static website:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<script type='text/javascript' src="core/dist/ionic.js"></script>
<link rel="stylesheet" href="core/css/ionic.bundle.css">
</head>
<body>
<ion-title>Sample</ion-title>
</body>
</html>
How to get core?
$ npm install @ionic/core
Will generate node_modules folder. Copy the folder from node_modules/@ionic/core to your project.
Folder structure should be:
projectFolder
..core
....css
......ionic.bundle.css
....dist
......ionic (contains all dependent js files)
......ionic.js
..index.html
Here’s the GitHub repo of above example.