Skip to content

Commit 742527e

Browse files
committed
Cleanup the output files
1 parent aa29918 commit 742527e

13 files changed

+444
-16
lines changed
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

dist/tsc/idb-cache.js

+427
Large diffs are not rendered by default.

examples/basic.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</style>
1212
</head>
1313
<body>
14-
<script src="../dist/idb-cache.js"></script>
14+
<script src="../dist/browser/idb-cache.js"></script>
1515
<script>
1616
console.log(IDBCache);
1717
var idbCache = new IDBCache("examples");

karma.conf.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module.exports = function(config) {
22
config.set({
33
frameworks: ['mocha', 'chai'],
4-
files: ['dist/idb-cache.js', 'test/index.js'],
4+
files: ['dist/browser/idb-cache.js', 'test/index.js'],
55
browsers: ['ChromeHeadless'],
66
reporters: ['mocha'],
77
singleRun: true,

package.json

+5-7
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,18 @@
44
"description": "idb-cache is a fast and simple cache library for JavaScript using IndexedDB",
55
"files": [
66
"README.md",
7-
"lib/idb-cache.js",
8-
"lib/idb-cache.mjs",
9-
"tsc/idb-cache.d.ts"
7+
"dist/"
108
],
11-
"main": "lib/idb-cache.js",
12-
"module": "lib/idb-cache.mjs",
13-
"types": "tsc/idb-cache.d.ts",
9+
"main": "dist/cjs/idb-cache.js",
10+
"module": "dist/esm/idb-cache.js",
11+
"types": "dist/tsc/idb-cache.d.ts",
1412
"scripts": {
1513
"test": "karma start",
1614
"build": "npm run build:tsc && npm run build:rollup:module && npm run build:rollup:browser && npm run build:uglifyjs && npm test",
1715
"build:tsc": "tsc",
1816
"build:rollup:module": "rollup -c",
1917
"build:rollup:browser": "rollup -c --environment BROWSER",
20-
"build:uglifyjs": "uglifyjs dist/idb-cache.js -o dist/idb-cache.min.js -cm -b beautify=false,preamble='\"// idb-cache - https://github.com/drecom/idb-cache\"'"
18+
"build:uglifyjs": "uglifyjs dist/browser/idb-cache.js -o dist/browser/idb-cache.min.js -cm -b beautify=false,preamble='\"// idb-cache - https://github.com/drecom/idb-cache\"'"
2119
},
2220
"repository": {
2321
"type": "git",

rollup.config.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const plugins = [];
55
if(process.env.BROWSER){
66
// Browser
77
output.push({
8-
file: 'dist/idb-cache.js',
8+
file: 'dist/browser/idb-cache.js',
99
format: 'iife',
1010
intro: '// idb-cache - https://github.com/drecom/idb-cache',
1111
name: 'IDBCache',
@@ -30,18 +30,18 @@ if(process.env.BROWSER){
3030
}else{
3131
// CommonJS Module
3232
output.push({
33-
file: 'lib/idb-cache.js',
33+
file: 'dist/cjs/idb-cache.js',
3434
format: 'cjs',
3535
});
3636
// ES Module
3737
output.push({
38-
file: 'lib/idb-cache.mjs',
38+
file: 'dist/esm/idb-cache.js',
3939
format: 'es',
4040
});
4141
}
4242

4343
export default {
44-
input: 'tsc/idb-cache.js',
44+
input: 'dist/tsc/idb-cache.js',
4545
output: output,
4646
plugins: plugins,
4747
};

idb-cache.ts src/idb-cache.ts

File renamed without changes.

tsconfig.json

+6-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/* Basic Options */
44
"target": "ES2015",
55
"module": "es2015",
6-
"outDir": "./tsc",
6+
"outDir": "./dist/tsc",
77
"declaration": true,
88

99
/* Strict Type-Checking Options */
@@ -16,5 +16,8 @@
1616

1717
/* Module Resolution Options */
1818
"esModuleInterop": true,
19-
}
20-
}
19+
},
20+
"files": [
21+
"src/idb-cache.ts",
22+
]
23+
}

0 commit comments

Comments
 (0)