Skip to content

Commit

Permalink
Bugfix import issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Timo committed Aug 13, 2021
1 parent 602b012 commit 8574774
Show file tree
Hide file tree
Showing 14 changed files with 2,446 additions and 1,914 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["minify"]
}
50 changes: 15 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,37 @@ You can find a running demo [here](http://www.timo-ernst.net/misc/f7-plugin-welc

### 1. Add dependency

#### With module bundler (Webpack, Vite...)

```shell
$ yarn add f7-welcomescreen
```

### 2. Import

In your main js file do:

```
import F7WelcomescreenPlugin from 'f7-welcomescreen';
```

Make sure you have css bundling in webpack enabled and import these stylesheets from your main css file:
In your stylesheet do:

```
@import '~framework7/framework7-bundle.min.css';
@import '~f7-welcomescreen/dist/main.css';
```

#### Alternative: Without bundler (direct linking)

1. Copy files `f7-welcomescreen.min.js` and `f7-welcomescreen.min.css` from `dist` into your project folder.
2. Reference the files in HTML like this:

```
<head>
<link rel="stylesheet" href="f7-welcomescreen.min.css"></link>
<script src="f7-welcomescreen.min.js></script>
</head>
```

### 3. Define slides

```javascript
Expand Down Expand Up @@ -138,38 +150,6 @@ See [demo](https://github.com/valnub/Framework7-Plugin-Welcomescreen/tree/master

I recommend to just run `yarn start` from the demo directory. Then open http://127.0.0.1:8080 in your browser.

## Troubleshooting

If you have issues importing dependencies, try this configuration in your `webpack.config.js`:

```
plugins: [new MiniCssExtractPlugin()],
module: {
rules: [
{
test: /\.m?js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env'],
},
},
},
{
test: /\.css$/,
use: [MiniCssExtractPlugin.loader, 'css-loader'],
},
],
},
```

And make sure you have all loaders installed:

```
$ yarn add babel-loader @babel/preset-env MiniCssExtractPlugin css-loader
```

## Credits

Made with <3 by www.timo-ernst.net
Expand Down
2 changes: 1 addition & 1 deletion demo/build/bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion demo/build/bundle.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion demo/build/main.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"@babel/preset-env": "^7.15.0",
"babel-loader": "^8.2.2",
"css-loader": "^6.2.0",
"f7-welcomescreen": "^3.0.3",
"f7-welcomescreen": "^3.0.4",
"framework7": "^6.2.0",
"http-server": "^13.0.0",
"mini-css-extract-plugin": "^2.2.0",
Expand Down
71 changes: 66 additions & 5 deletions demo/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,27 @@
resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.15.0.tgz#2dbaf8b85334796cafbb0f5793a90a2fc010b176"
integrity sha512-0NqAC1IJE0S0+lL1SWFMxMkz1pKCNCjI4tr2Zx4LJSXxCLAdr6KyArnY+sno5m3yH9g737ygOyPABDsnXkpxiA==

"@babel/core@^7.15.0":
version "7.15.0"
resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.15.0.tgz#749e57c68778b73ad8082775561f67f5196aafa8"
integrity sha512-tXtmTminrze5HEUPn/a0JtOzzfp0nk+UEXQ/tqIJo3WDGypl/2OFQEMll/zSFU8f/lfmfLXvTaORHF3cfXIQMw==
dependencies:
"@babel/code-frame" "^7.14.5"
"@babel/generator" "^7.15.0"
"@babel/helper-compilation-targets" "^7.15.0"
"@babel/helper-module-transforms" "^7.15.0"
"@babel/helpers" "^7.14.8"
"@babel/parser" "^7.15.0"
"@babel/template" "^7.14.5"
"@babel/traverse" "^7.15.0"
"@babel/types" "^7.15.0"
convert-source-map "^1.7.0"
debug "^4.1.0"
gensync "^1.0.0-beta.2"
json5 "^2.1.2"
semver "^6.3.0"
source-map "^0.5.0"

"@babel/generator@^7.15.0":
version "7.15.0"
resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.15.0.tgz#a7d0c172e0d814974bad5aa77ace543b97917f15"
Expand Down Expand Up @@ -212,6 +233,15 @@
"@babel/traverse" "^7.14.5"
"@babel/types" "^7.14.5"

"@babel/helpers@^7.14.8":
version "7.15.3"
resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.15.3.tgz#c96838b752b95dcd525b4e741ed40bb1dc2a1357"
integrity sha512-HwJiz52XaS96lX+28Tnbu31VeFSQJGOeKHJeaEPQlTl7PnlhFElWPj8tUXtqFIzeN86XxXoBr+WFAyK2PPVz6g==
dependencies:
"@babel/template" "^7.14.5"
"@babel/traverse" "^7.15.0"
"@babel/types" "^7.15.0"

"@babel/highlight@^7.14.5":
version "7.14.5"
resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.14.5.tgz#6861a52f03966405001f6aa534a01a24d99e8cd9"
Expand Down Expand Up @@ -1446,6 +1476,13 @@ configstore@^5.0.1:
write-file-atomic "^3.0.0"
xdg-basedir "^4.0.0"

convert-source-map@^1.7.0:
version "1.8.0"
resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.8.0.tgz#f3373c32d21b4d780dd8004514684fb791ca4369"
integrity sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==
dependencies:
safe-buffer "~5.1.1"

copy-descriptor@^0.1.0:
version "0.1.1"
resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d"
Expand Down Expand Up @@ -1765,10 +1802,17 @@ extglob@^2.0.4:
snapdragon "^0.8.1"
to-regex "^3.0.1"

f7-welcomescreen@^2.1.5:
version "2.1.5"
resolved "https://registry.yarnpkg.com/f7-welcomescreen/-/f7-welcomescreen-2.1.5.tgz#6b01120bc512ee6bb63bfd3dea390766e00b695e"
integrity sha512-ATOyAWHKDmROGQRnhkqoGf+oBOAQg53fIAte4GalcQgaVz7PMJq35lAmCVydPJOzJ75l2xgvGcVt/ul5nK1x2w==
f7-welcomescreen@^3.0.3:
version "3.0.3"
resolved "https://registry.yarnpkg.com/f7-welcomescreen/-/f7-welcomescreen-3.0.3.tgz#6bfad62bad324c81a20b628de277d95aef8ead1d"
integrity sha512-iHDy36AMSGYZ9Rt7Rt4uZnEh7NGM6713TBGVG44ULX+sDPxEjUD6pXqkpCotKoTFFadqfGt0wjoUeSwYcmc8cw==
dependencies:
"@babel/core" "^7.15.0"
"@babel/preset-env" "^7.15.0"
babel-loader "^8.2.2"
swiper "^6.8.1"
template7 "^1.4.2"
webpack "^5.50.0"

fast-deep-equal@^3.1.1:
version "3.1.3"
Expand Down Expand Up @@ -1870,6 +1914,11 @@ function-bind@^1.1.1:
resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d"
integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==

gensync@^1.0.0-beta.2:
version "1.0.0-beta.2"
resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0"
integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==

get-caller-file@^2.0.1:
version "2.0.5"
resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e"
Expand Down Expand Up @@ -2371,6 +2420,13 @@ json5@^1.0.1:
dependencies:
minimist "^1.2.0"

json5@^2.1.2:
version "2.2.0"
resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.0.tgz#2dfefe720c6ba525d9ebd909950f0515316c89a3"
integrity sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==
dependencies:
minimist "^1.2.5"

keyv@^3.0.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/keyv/-/keyv-3.1.0.tgz#ecc228486f69991e49e9476485a5be1e8fc5c4d9"
Expand Down Expand Up @@ -3414,7 +3470,7 @@ supports-color@^8.0.0:
dependencies:
has-flag "^4.0.0"

swiper@^6.6.2:
swiper@^6.6.2, swiper@^6.8.1:
version "6.8.1"
resolved "https://registry.yarnpkg.com/swiper/-/swiper-6.8.1.tgz#79a48ee5c9105c16d55da035eb0245cc2f696f2b"
integrity sha512-Gc2rKe0XH3zoB0ogonlielduGM9DDQCJtXAeFeD2ujwzhEqw+5udwebCMNjhAcQ+xl9ygM5PnRoziAUol3Dx5w==
Expand All @@ -3432,6 +3488,11 @@ tapable@^2.1.1, tapable@^2.2.0:
resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.2.0.tgz#5c373d281d9c672848213d0e037d1c4165ab426b"
integrity sha512-FBk4IesMV1rBxX2tfiK8RAmogtWn53puLOQlvO8XuwlgxcYbP4mVPS9Ph4aeamSyyVjOl24aYWAuc8U5kCVwMw==

template7@^1.4.2:
version "1.4.2"
resolved "https://registry.yarnpkg.com/template7/-/template7-1.4.2.tgz#62f32959361e455ec171ef9ef33d29ca7130e009"
integrity sha512-eoKnScBMDk7lyj7+iCzKbxGiSLLlQk0DNvmclyJuMCUKxy9JrFuAB+GD5iplF4WiQPtMdI06CHHks3avL22JXA==

term-size@^2.1.0:
version "2.2.1"
resolved "https://registry.yarnpkg.com/term-size/-/term-size-2.2.1.tgz#2a6a54840432c2fb6320fea0f415531e90189f54"
Expand Down
1 change: 1 addition & 0 deletions dist/f7-welcomescreen.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions dist/f7-welcomescreen.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion dist/index.js

This file was deleted.

91 changes: 0 additions & 91 deletions dist/main.css

This file was deleted.

15 changes: 7 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "f7-welcomescreen",
"version": "3.0.3",
"version": "3.0.4",
"description": "This Framework7 plugin will guide the user through a tour of your app.",
"main": "dist/index.js",
"scripts": {
"clean": "rm -Rf dist",
"build": "yarn clean && webpack && cp src/main.css dist"
"build": "yarn clean && mkdir dist && babel src --out-file dist/f7-welcomescreen.min.js && css-minify -f src/main.css -o dist && mv dist/main.min.css dist/f7-welcomescreen.min.css"
},
"repository": {
"type": "git",
Expand All @@ -18,14 +18,13 @@
},
"homepage": "https://github.com/valnub/Framework7-Plugin-Welcomescreen",
"dependencies": {
"@babel/core": "^7.15.0",
"@babel/preset-env": "^7.15.0",
"babel-loader": "^8.2.2",
"css-minify": "^2.0.0",
"swiper": "^6.8.1",
"template7": "^1.4.2",
"webpack": "^5.50.0"
"template7": "^1.4.2"
},
"devDependencies": {
"webpack-cli": "^4.7.2"
"babel-cli": "^6.26.0",
"babel-preset-env": "^1.7.0",
"babel-preset-minify": "^0.5.1"
}
}
26 changes: 0 additions & 26 deletions webpack.config.js

This file was deleted.

Loading

0 comments on commit 8574774

Please sign in to comment.