Skip to content
This repository was archived by the owner on Feb 22, 2021. It is now read-only.

Commit 1f5bb9d

Browse files
authored
Merge pull request #2 from WittBulter/load-scripts
feat(loader): loader script
2 parents 5e1f2f1 + a95c9ca commit 1f5bb9d

File tree

20 files changed

+670
-12
lines changed

20 files changed

+670
-12
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ script:
1919
- npm run ex:build && npm run release
2020

2121
after_success:
22-
- npm run cover
22+
- npm run cover:hook

build/webpack.base.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ module.exports = {
2424
loaders: [
2525
{
2626
loader: 'awesome-typescript-loader',
27-
options: { configFileName: path.resolve(__dirname, '../examples/tsconfig.json') },
27+
options: { configFileName: path.resolve(__dirname, '../examples/tsconfig.ex.json') },
2828
},
2929
],
3030
},

examples/main.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,15 @@
1-
1+
import { BackLoader } from '../src/index'
22
document.title = 'hello'
3+
4+
const handler = async() => {
5+
const backLoader = new BackLoader({
6+
// scripts: ['https://code.jquery.com/jquery-3.2.1.slim.min.js'],
7+
// pages: ['https://google.com'],
8+
images: ['https://cn.bing.com/az/hprichbg/rb/BarHarborCave_ZH-CN8055769470_1920x1080.jpg'],
9+
})
10+
backLoader.start().on(event => {
11+
console.log(event)
12+
})
13+
}
14+
15+
;(() => window.onload = () => handler().then())()

0 commit comments

Comments
 (0)