* Webpack config changes

* Updated documentation with example
* removed unwanted dependencies from starter pack
This commit is contained in:
Indrajith K L
2017-12-19 19:10:01 +05:30
parent 90d191ce4b
commit 9b608b89b1
13 changed files with 56 additions and 27 deletions

14
.vscode/launch.json vendored Normal file
View File

@@ -0,0 +1,14 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceFolder}\\src\\index.ts"
}
]
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -79,6 +79,8 @@ position filed expects an array of two values. This determines where the notific
number filed is the one which determines how much time notification should be visible. It expects time in **milliseconds**. Default value is *6000ms(6s)* number filed is the one which determines how much time notification should be visible. It expects time in **milliseconds**. Default value is *6000ms(6s)*
#### [example](http://libvyn.indrajith.surge.sh/example/example.html)
### Support ME ### Support ME
[![](https://az743702.vo.msecnd.net/cdn/kofi2.png?v=0)](https://ko-fi.com/R6R36EBQ) [![](https://az743702.vo.msecnd.net/cdn/kofi2.png?v=0)](https://ko-fi.com/R6R36EBQ)

View File

Before

Width:  |  Height:  |  Size: 206 B

After

Width:  |  Height:  |  Size: 206 B

23
docs/example/example.html Normal file
View File

@@ -0,0 +1,23 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Vanilla Yo Notification</title>
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Roboto:300,300italic,700,700italic">
<link rel="stylesheet" href="//cdn.rawgit.com/necolas/normalize.css/master/normalize.css">
<link rel="stylesheet" href="//cdn.rawgit.com/milligram/milligram/master/dist/milligram.min.css">
</head>
<body>
<button class="button" onclick="showNotificationSuccess()">Show Success Notification</button>
<button class="button" onclick="showNotificationWarning()">Show Warning Notification</button>
<button class="button" onclick="showNotificationError()">Show Error Notification</button>
<script src="./vanilla-yo-notification.js"></script>
<script src="./example.js"></script>
</body>
</html>

View File

@@ -1,6 +1,6 @@
(function(window){ (function(window){
var notif = new VanillaYoNotification({ var notif = new VYN({
position: ['bottom', 'left'] position: ['bottom', 'right']
}); });
var counter = 0; var counter = 0;
window.showNotificationSuccess = function(){ window.showNotificationSuccess = function(){

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -13,7 +13,7 @@
<script> <script>
window.$docsify = { window.$docsify = {
name: 'vanilla-yo-notification', name: 'vanilla-yo-notification',
repo: '' repo: 'https://github.com/cooljith91112/vanilla-yo-notification'
} }
</script> </script>
<script src="//unpkg.com/docsify/lib/docsify.min.js"></script> <script src="//unpkg.com/docsify/lib/docsify.min.js"></script>

View File

@@ -1,17 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Vanilla Yo Notification</title>
</head>
<body>
<button onclick="showNotificationSuccess()">Show Success Notification</button>
<button onclick="showNotificationWarning()">Show Warning Notification</button>
<button onclick="showNotificationError()">Show Error Notification</button>
<script src="../dist/vanilla-yo-notification.js"></script>
<script src="./example.js"></script>
</body>
</html>

View File

@@ -42,7 +42,7 @@
"tslint-loader": "^3.5.3", "tslint-loader": "^3.5.3",
"typescript": "^2.4.1", "typescript": "^2.4.1",
"webpack": "^3.3.0", "webpack": "^3.3.0",
"webpack-dashboard": "^0.4.0", "webpack-dev-server": "2.5.1",
"webpack-dev-server": "2.5.1" "webpack-shell-plugin": "^0.5.0"
} }
} }

View File

@@ -1,10 +1,12 @@
const webpack = require("webpack"); const webpack = require("webpack");
const path = require("path"); const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const DashboardPlugin = require("webpack-dashboard/plugin"); const DashboardPlugin = require("webpack-dashboard/plugin");
const WebpackShellPlugin = require('webpack-shell-plugin');
const nodeEnv = process.env.NODE_ENV || "development"; const nodeEnv = process.env.NODE_ENV || "development";
const isProd = nodeEnv === "production"; const isProd = nodeEnv === "production";
console.log(webpack.plugins);
var config = { var config = {
devtool: isProd ? "hidden-source-map" : "source-map", devtool: isProd ? "hidden-source-map" : "source-map",
context: path.resolve("./src"), context: path.resolve("./src"),
@@ -45,7 +47,6 @@ var config = {
output: { comments: false }, output: { comments: false },
sourceMap: true sourceMap: true
}), }),
new DashboardPlugin(),
new webpack.LoaderOptionsPlugin({ new webpack.LoaderOptionsPlugin({
options: { options: {
tslint: { tslint: {
@@ -53,6 +54,9 @@ var config = {
failOnHint: true failOnHint: true
} }
} }
}),
new WebpackShellPlugin({
onBuildEnd: 'cp -r dist/* docs/example/'
}) })
], ],
devServer: { devServer: {