提交 17851f61 编写于 作者: K Kamran Ahmed

Update dependencies and update build

上级 e5e57cf6
...@@ -11,7 +11,6 @@ const styleFileName = 'driver-demo.min.css'; ...@@ -11,7 +11,6 @@ const styleFileName = 'driver-demo.min.css';
module.exports = { module.exports = {
mode: isProduction ? 'production' : 'development', mode: isProduction ? 'production' : 'development',
entry: [ entry: [
!isProduction && 'webpack-dev-server/client?http://localhost:3000',
'./demo/styles/demo.scss', './demo/styles/demo.scss',
'./demo/scripts/demo.js', './demo/scripts/demo.js',
'./src/index.js', './src/index.js',
...@@ -46,7 +45,7 @@ module.exports = { ...@@ -46,7 +45,7 @@ module.exports = {
loader: ExtractTextPlugin.extract([ loader: ExtractTextPlugin.extract([
{ {
loader: 'css-loader', loader: 'css-loader',
options: { minimize: isProduction, url: false }, options: { url: false },
}, },
'sass-loader', 'sass-loader',
]), ]),
...@@ -73,7 +72,10 @@ module.exports = { ...@@ -73,7 +72,10 @@ module.exports = {
canPrint: true, canPrint: true,
}), }),
new CopyWebpackPlugin([ new CopyWebpackPlugin([
{ from: './demo/images/', to: 'images' } {
from: './demo/images/',
to: 'images',
},
]), ]),
new HtmlWebpackPlugin({ new HtmlWebpackPlugin({
template: 'demo/index.html', template: 'demo/index.html',
......
...@@ -38,7 +38,7 @@ module.exports = { ...@@ -38,7 +38,7 @@ module.exports = {
loader: ExtractTextPlugin.extract([ loader: ExtractTextPlugin.extract([
{ {
loader: 'css-loader', loader: 'css-loader',
options: { minimize: true, url: false }, options: { url: false },
}, },
'sass-loader', 'sass-loader',
]), ]),
......
...@@ -6,7 +6,6 @@ document.addEventListener('DOMContentLoaded', function () { ...@@ -6,7 +6,6 @@ document.addEventListener('DOMContentLoaded', function () {
{ {
element: document.getElementById('driver-demo-head'), element: document.getElementById('driver-demo-head'),
popover: { popover: {
className: 'scoped-driver-popover',
title: 'Before we start', title: 'Before we start',
description: 'This is just one use-case, make sure to check out the rest of the docs below.', description: 'This is just one use-case, make sure to check out the rest of the docs below.',
nextBtnText: 'Okay, Start!', nextBtnText: 'Okay, Start!',
...@@ -103,7 +102,6 @@ document.addEventListener('DOMContentLoaded', function () { ...@@ -103,7 +102,6 @@ document.addEventListener('DOMContentLoaded', function () {
opacity: 0.8, opacity: 0.8,
padding: 5, padding: 5,
showButtons: true, showButtons: true,
className: 'boring-scope'
}); });
boringTourDriver.defineSteps(tourSteps); boringTourDriver.defineSteps(tourSteps);
...@@ -128,9 +126,10 @@ document.addEventListener('DOMContentLoaded', function () { ...@@ -128,9 +126,10 @@ document.addEventListener('DOMContentLoaded', function () {
}); });
document.querySelectorAll('pre code').forEach((element) => { document.querySelectorAll('pre code')
hljs.highlightBlock(element); .forEach((element) => {
}); hljs.highlightBlock(element);
});
///////////////////////////////////////////// /////////////////////////////////////////////
...@@ -150,9 +149,10 @@ document.addEventListener('DOMContentLoaded', function () { ...@@ -150,9 +149,10 @@ document.addEventListener('DOMContentLoaded', function () {
const inputIds = ['creation-input', 'creation-input-2', 'creation-input-3', 'creation-input-4']; const inputIds = ['creation-input', 'creation-input-2', 'creation-input-3', 'creation-input-4'];
inputIds.forEach(inputId => { inputIds.forEach(inputId => {
// Highlight the section on focus // Highlight the section on focus
document.getElementById(inputId).addEventListener('focus', () => { document.getElementById(inputId)
focusDriver.highlight(`#${inputId}`); .addEventListener('focus', () => {
}); focusDriver.highlight(`#${inputId}`);
});
}); });
///////////////////////////////////////////// /////////////////////////////////////////////
...@@ -317,10 +317,11 @@ document.addEventListener('DOMContentLoaded', function () { ...@@ -317,10 +317,11 @@ document.addEventListener('DOMContentLoaded', function () {
} }
}]); }]);
document.querySelector('#run-single-element-no-close').addEventListener('click', function (e) { document.querySelector('#run-single-element-no-close')
e.preventDefault(); .addEventListener('click', function (e) {
singleNoClose.start(); e.preventDefault();
}); singleNoClose.start();
});
///////////////////////////////////////////////////// /////////////////////////////////////////////////////
// Highlighting single element with popover position // Highlighting single element with popover position
......
此差异已折叠。
...@@ -18,33 +18,33 @@ ...@@ -18,33 +18,33 @@
"author": "Kamran Ahmed <kamranahmed.se@gmail.com>", "author": "Kamran Ahmed <kamranahmed.se@gmail.com>",
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {
"@babel/core": "^7.0.0", "@babel/core": "^7.2.2",
"@babel/plugin-proposal-object-rest-spread": "^7.0.0", "@babel/plugin-proposal-object-rest-spread": "^7.3.2",
"@babel/preset-env": "^7.0.0", "@babel/preset-env": "^7.3.1",
"babel-eslint": "^10.0.1", "babel-eslint": "^10.0.1",
"babel-loader": "^8.0.0", "babel-loader": "^8.0.5",
"copy-webpack-plugin": "^4.5.1", "copy-webpack-plugin": "^4.6.0",
"css-loader": "^1.0.0", "css-loader": "^2.1.0",
"cssnano": "^4.1.4", "cssnano": "^4.1.8",
"eslint": "^5.6.1", "eslint": "^5.13.0",
"eslint-config-airbnb-base": "^13.1.0", "eslint-config-airbnb-base": "^13.1.0",
"eslint-loader": "^2.0.0", "eslint-loader": "^2.1.2",
"eslint-plugin-import": "^2.9.0", "eslint-plugin-import": "^2.16.0",
"eslint-plugin-node": "^7.0.1", "eslint-plugin-node": "^8.0.1",
"extract-loader": "^3.0.0", "extract-loader": "^3.1.0",
"extract-text-webpack-plugin": "next", "extract-text-webpack-plugin": "next",
"file-loader": "^2.0.0", "file-loader": "^3.0.1",
"gh-pages": "^2.0.1", "gh-pages": "^2.0.1",
"html-webpack-plugin": "^3.2.0", "html-webpack-plugin": "^3.2.0",
"node-sass": "^4.7.2", "node-sass": "^4.11.0",
"opn": "^5.2.0", "opn": "^5.4.0",
"optimize-css-assets-webpack-plugin": "^5.0.1", "optimize-css-assets-webpack-plugin": "^5.0.1",
"postcss-loader": "^3.0.0", "postcss-loader": "^3.0.0",
"sass-loader": "^7.1.0", "sass-loader": "^7.1.0",
"style-loader": "^0.23.1", "style-loader": "^0.23.1",
"webpack": "^4.0.1", "webpack": "^4.29.2",
"webpack-cli": "^3.1.2", "webpack-cli": "^3.2.3",
"webpack-dev-server": "^3.1.0" "webpack-dev-server": "^3.1.14"
}, },
"dependencies": {} "dependencies": {}
} }
...@@ -6,16 +6,17 @@ const config = require('./config/webpack.config.demo'); ...@@ -6,16 +6,17 @@ const config = require('./config/webpack.config.demo');
const PORT = 3000; const PORT = 3000;
const HOST = 'localhost'; const HOST = 'localhost';
const URL = `http://${HOST}:${PORT}/dist/demo`; const URL = `http://${HOST}:${PORT}`;
new WebpackDevServer(webpack(config), { config.entry.unshift(`webpack-dev-server/client?${URL}`);
publicPath: config.output.publicPath,
}).listen(PORT, HOST, (error, result) => {
if (error) {
console.error(error);
return;
}
opn(URL); new WebpackDevServer(webpack(config))
console.log(`Listening at ${URL}`); .listen(PORT, HOST, (error) => {
}); if (error) {
console.error(error);
return;
}
opn(URL);
console.log(`Listening at ${URL}`);
});
...@@ -170,7 +170,7 @@ div#driver-popover-item { ...@@ -170,7 +170,7 @@ div#driver-popover-item {
} }
div#driver-page-overlay { div#driver-page-overlay {
background: black; background: #000000;
position: fixed; position: fixed;
top: 0; top: 0;
left: 0; left: 0;
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册