Skip to content

Commit

Permalink
First time making this package work in another project - untested if …
Browse files Browse the repository at this point in the history
…this project still works
  • Loading branch information
Staijn1 committed Jun 9, 2024
1 parent ffcff26 commit 3382027
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 13 deletions.
8 changes: 8 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@
"preview": "vite preview",
"test": "cypress run"
},
"exports": {
".": {
"import": "./dist/aos.umd.cjs",
"require": "./dist/aos.umd.cjs",
"types": "./dist/aos.d.ts"
},
"./dist/aos.css": "./dist/aos.css"
},
"devDependencies": {
"@rollup/plugin-babel": "^6.0.4",
"@types/lodash.debounce": "^4.0.9",
Expand Down
Empty file added src/index.d.ts
Empty file.
13 changes: 4 additions & 9 deletions src/js/aos.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,18 +228,13 @@ const init = function init(settings) {
return $aosElements;
};

/**
* Export Public API
*/

const AOS = {
init,
refresh,
refreshHard
}

window.AOS = AOS;
// window.AOS = AOS;

/**
* Export Public API
*/
export default {
init,
refresh,
Expand Down
16 changes: 12 additions & 4 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,22 @@ const plugins = [
export default defineConfig({
root: './demo',
build: {
lib: {
name: 'AOS',
entry: '../src/js/aos.js',
fileName: 'aos',
formats: ['umd']
},
rollupOptions: {
input: 'src/js/aos.js',
output: {
dir: 'dist',
entryFileNames: 'aos.js',
format: 'umd',
sourcemap: process.env.NODE_ENV === 'dev'
globals: {
'aos': 'AOS'
}
},
// output: {
// entryFileNames: 'aos.js',
// },
plugins: plugins
}
},
Expand Down

0 comments on commit 3382027

Please sign in to comment.