-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First init. Working fine with 'useBuiltIns: false' and '@babel/polyfi…
…ll' added to entry
- Loading branch information
StabbarN
committed
Apr 5, 2018
0 parents
commit 3821b29
Showing
6 changed files
with
4,148 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
*.sublime-* | ||
node_modules | ||
build | ||
yarn-error.log | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// import 'babel-polyfill' | ||
// import '@babel/polyfill' | ||
|
||
import 'indexeddbshim' | ||
window.shimIndexedDB.__useShim() | ||
import Dexie from 'dexie' | ||
|
||
(function() { | ||
const shimIndexedDB = window.shimIndexedDB | ||
const shimIDBKeyRange = window.IDBKeyRange | ||
|
||
const db = new Dexie('testDBshim', { | ||
autoOpen: false, | ||
indexedDB: shimIndexedDB, | ||
IDBKeyRange: shimIDBKeyRange, | ||
}) | ||
db.version(1).stores({ | ||
logs: '++id', | ||
}) | ||
console.log('Will open DB') | ||
// alert('Will open DB') | ||
db.open().then(() => { | ||
console.log('Did open DB') | ||
// alert('Did open DB') | ||
|
||
const testLog = { | ||
message: 'first log' | ||
} | ||
return db['logs'].add(testLog) | ||
}).then(() => { | ||
alert('Did add first log') | ||
}).catch((err) => { | ||
alert('Caught an error:' + err) | ||
}) | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!doctype html> | ||
|
||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Shim test</title> | ||
</head> | ||
|
||
<body> | ||
<p>Init shim</p> | ||
<script src="/build/bundle.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"name": "punch_clock_main", | ||
"version": "1.0.0", | ||
"main": "app.js", | ||
"author": "", | ||
"license": "MIT", | ||
"scripts": {}, | ||
"dependencies": { | ||
"@babel/core": "^7.0.0-beta.44", | ||
"@babel/polyfill": "^7.0.0-beta.44", | ||
"@babel/preset-env": "^7.0.0-beta.44", | ||
"babel-loader": "^8.0.0-beta.2", | ||
"dexie": "^2.0.2", | ||
"indexeddbshim": "^3.5.1", | ||
"serve": "^6.5.3", | ||
"webpack": "^3.10.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
var path = require( 'path' ) // eslint-disable-line no-undef | ||
|
||
const config = { | ||
entry: [ | ||
// 'babel-polyfill', | ||
'@babel/polyfill', | ||
'./app/app.js' | ||
], | ||
output: { | ||
path: path.resolve(__dirname, "build"), | ||
publicPath: "/assets/", | ||
filename: "bundle.js" | ||
}, | ||
resolve: { | ||
extensions: ['.js'] | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.(js)?$/, | ||
loader: 'babel-loader', | ||
options: { | ||
babelrc: false, | ||
presets: [ | ||
['@babel/preset-env', { | ||
useBuiltIns: false, | ||
targets: { | ||
browsers: [ | ||
'iOS >= 9', | ||
], | ||
}, | ||
}], | ||
], | ||
plugins: [ | ||
// '@babel/plugin-transform-sticky-regex', | ||
], | ||
}, | ||
} | ||
], | ||
}, | ||
} | ||
module.exports = config |
Oops, something went wrong.