mirror of
https://github.com/chinchang/web-maker.git
synced 2025-06-09 03:07:20 +02:00
more stuff
This commit is contained in:
parent
5d0df8bc55
commit
df317d0dd4
@ -29,6 +29,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@emmetio/codemirror-plugin": "^0.5.4",
|
"@emmetio/codemirror-plugin": "^0.5.4",
|
||||||
"codemirror": "^5.37.0",
|
"codemirror": "^5.37.0",
|
||||||
|
"copy-webpack-plugin": "^4.5.1",
|
||||||
"esprima": "^4.0.0",
|
"esprima": "^4.0.0",
|
||||||
"firebase": "^5.0.4",
|
"firebase": "^5.0.4",
|
||||||
"preact": "^8.2.6",
|
"preact": "^8.2.6",
|
||||||
|
53
webmaker/preact.config.js
Normal file
53
webmaker/preact.config.js
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
import CopyWebpackPlugin from 'copy-webpack-plugin'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function that mutates original webpack config.
|
||||||
|
* Supports asynchronous changes when promise is returned.
|
||||||
|
*
|
||||||
|
* @param {object} config - original webpack config.
|
||||||
|
* @param {object} env - options passed to CLI.
|
||||||
|
* @param {WebpackConfigHelpers} helpers - object with useful helpers when working with config.
|
||||||
|
**/
|
||||||
|
export default function (config, env, helpers) {
|
||||||
|
if (env.isProd) {
|
||||||
|
config.devtool = false; // disable sourcemaps
|
||||||
|
}
|
||||||
|
config.plugins.push(new CopyWebpackPlugin([{
|
||||||
|
context: `${__dirname}/src/assets`,
|
||||||
|
from: `*.*`
|
||||||
|
}, {
|
||||||
|
from: `${__dirname}/src/lib`,
|
||||||
|
to: 'lib/'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
from: `${__dirname}/src/detached-window.js`
|
||||||
|
},
|
||||||
|
{
|
||||||
|
from: `${__dirname}/src/*.ttf`
|
||||||
|
},
|
||||||
|
{
|
||||||
|
from: `${__dirname}/src/patreon.png`
|
||||||
|
},
|
||||||
|
{
|
||||||
|
from: `${__dirname}/src/preview.html`
|
||||||
|
},
|
||||||
|
{
|
||||||
|
from: `${__dirname}/src/style.css`
|
||||||
|
}
|
||||||
|
]));
|
||||||
|
|
||||||
|
// let plugins = helpers.getPlugins();
|
||||||
|
// console.log(helpers.getPlugins(config));
|
||||||
|
|
||||||
|
const {
|
||||||
|
plugin
|
||||||
|
} = helpers.getPluginsByName(config, 'SWPrecacheWebpackPlugin')[0];
|
||||||
|
console.log(plugin)
|
||||||
|
plugin.options.maximumFileSizeToCacheInBytes = 2900000;
|
||||||
|
|
||||||
|
|
||||||
|
let {
|
||||||
|
index
|
||||||
|
} = helpers.getPluginsByName(config, 'UglifyJsPlugin')[0]
|
||||||
|
config.plugins.splice(index, 1)
|
||||||
|
}
|
@ -225,7 +225,7 @@ export default class SavedItemPane extends Component {
|
|||||||
|
|
||||||
<div id="js-saved-items-wrap" class="saved-items-pane__container">
|
<div id="js-saved-items-wrap" class="saved-items-pane__container">
|
||||||
{!this.state.filteredItems.length &&
|
{!this.state.filteredItems.length &&
|
||||||
!this.items.length && <div class="mt-1">No match found.</div>}
|
this.items.length && <div class="mt-1">No match found.</div>}
|
||||||
{this.state.filteredItems.map(item => (
|
{this.state.filteredItems.map(item => (
|
||||||
<div
|
<div
|
||||||
class="js-saved-item-tile saved-item-tile"
|
class="js-saved-item-tile saved-item-tile"
|
||||||
|
@ -1,18 +0,0 @@
|
|||||||
import { h, Component } from 'preact';
|
|
||||||
import { Link } from 'preact-router/match';
|
|
||||||
import style from './style';
|
|
||||||
|
|
||||||
export default class Header extends Component {
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<header class={style.header}>
|
|
||||||
<h1>Preact App</h1>
|
|
||||||
<nav>
|
|
||||||
<Link activeClassName={style.active} href="/">Home</Link>
|
|
||||||
<Link activeClassName={style.active} href="/profile">Me</Link>
|
|
||||||
<Link activeClassName={style.active} href="/profile/john">John</Link>
|
|
||||||
</nav>
|
|
||||||
</header>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,48 +0,0 @@
|
|||||||
.header {
|
|
||||||
position: fixed;
|
|
||||||
left: 0;
|
|
||||||
top: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 56px;
|
|
||||||
padding: 0;
|
|
||||||
background: #673AB7;
|
|
||||||
box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
|
|
||||||
z-index: 50;
|
|
||||||
}
|
|
||||||
|
|
||||||
.header h1 {
|
|
||||||
float: left;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0 15px;
|
|
||||||
font-size: 24px;
|
|
||||||
line-height: 56px;
|
|
||||||
font-weight: 400;
|
|
||||||
color: #FFF;
|
|
||||||
}
|
|
||||||
|
|
||||||
.header nav {
|
|
||||||
float: right;
|
|
||||||
font-size: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.header nav a {
|
|
||||||
display: inline-block;
|
|
||||||
height: 56px;
|
|
||||||
line-height: 56px;
|
|
||||||
padding: 0 15px;
|
|
||||||
min-width: 50px;
|
|
||||||
text-align: center;
|
|
||||||
background: rgba(255,255,255,0);
|
|
||||||
text-decoration: none;
|
|
||||||
color: #FFF;
|
|
||||||
will-change: background-color;
|
|
||||||
}
|
|
||||||
|
|
||||||
.header nav a:hover,
|
|
||||||
.header nav a:active {
|
|
||||||
background: rgba(0,0,0,0.2);
|
|
||||||
}
|
|
||||||
|
|
||||||
.header nav a.active {
|
|
||||||
background: rgba(0,0,0,0.4);
|
|
||||||
}
|
|
@ -1,7 +0,0 @@
|
|||||||
import { h, Component } from 'preact';
|
|
||||||
|
|
||||||
export default class Header extends Component {
|
|
||||||
render() {
|
|
||||||
return <header class={style.header} />;
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user