./dist - output of chrome extension
./src - all source files
./src/chrome - chrome extension javascript files
./src/entry - Vue entry points
./src/view - Vue components
./src/assets - assets (used by components)
./public/_base.html - template file (used to generate Vue entry points)
./public/index.html - dev page (eg. "npm run serve")
./tests - tests
Default route will no longer load. vuejs.config.js
maps each component
in src/entry/..
into its own page.
const chromeName = getEntryFile(path.resolve(`src/entry`))
// ...
chromeName.forEach((name) => {
// ...
pages[fileName] = {
entry: `src/entry/${name}`,
template: 'public/index.html',
filename: `${fileName}.html`
}
})
Therefore, to test src/entry/main.ts
(or any file that mounts '#app' via createApp()
)
the URL looks like: http://localhost:8080/logged_out.html
npm install
# executes build + watch for chrome extension development
npm run build-watch
npm run build
npm run test:unit
npm run lint
https://www.npmjs.com/package/vue-cli-plugin-chrome-extension-cli
# Created a Vue.js project
vue create sample-extension
cd sample-extension/
# Add chrome extension support
vue add chrome-extension-cli
Update default vue.config.js
to keep serviceWorker code separate from Vue
and to use a different 'base' template for entry pages.