Skip to content

Commit 9dbde82

Browse files
committedSep 30, 2019
init project
0 parents  commit 9dbde82

20 files changed

+10859
-0
lines changed
 

‎.babelrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"presets": ["@babel/preset-env"],
3+
"plugins": [
4+
"syntax-dynamic-import"
5+
]
6+
}

‎.editorconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 4
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
12+
[*.json]
13+
indent_size = 2
14+
indent_style = space

‎.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
## System and generated files
2+
.idea
3+
.DS_Store
4+
.sass-cache
5+
6+
## Directories
7+
log/
8+
dist/
9+
node_modules/
10+
bower_components/
11+
12+
## Files
13+
result.xml
14+
npm-debug.log

‎LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2018 Christoph von Gellhorn
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

‎README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
Webpack 4 Boilerplate
2+
===========
3+
4+
[![Dependency Status](https://david-dm.org/cvgellhorn/webpack-boilerplate.svg)](https://david-dm.org/cvgellhorn/webpack-boilerplate)
5+
[![devDependency Status](https://david-dm.org/cvgellhorn/webpack-boilerplate/dev-status.svg)](https://david-dm.org/cvgellhorn/webpack-boilerplate)
6+
7+
> Plain webpack 4 boilerplate with Babel, SASS and lodash on board
8+
9+
## Requirements
10+
You only need <b>node.js</b> pre-installed and you’re good to go.
11+
12+
If you don’t want to work with lodash, just remove it from the node packages and the webpack config.
13+
14+
## Usage
15+
Download to target directory or use this repository as a template
16+
```sh
17+
$ curl -L -o master.zip https://github.com/cvgellhorn/webpack-boilerplate/archive/master.zip && unzip master.zip && rm master.zip && mv ./webpack-boilerplate-master/{.,}* ./ && rm -r ./webpack-boilerplate-master
18+
```
19+
20+
## Setup
21+
Install dependencies
22+
```sh
23+
$ npm install
24+
```
25+
26+
## Development
27+
Run the local webpack-dev-server with livereload and autocompile on [http://localhost:8080/](http://localhost:8080/)
28+
```sh
29+
$ npm run dev
30+
```
31+
## Deployment
32+
Build the current application
33+
```sh
34+
$ npm run build
35+
```
36+
37+
## [webpack](https://webpack.js.org/)
38+
If you're not familiar with webpack, the [webpack-dev-server](https://webpack.js.org/configuration/dev-server/) will serve the static files in your build folder and watch your source files for changes.
39+
When changes are made the bundle will be recompiled. This modified bundle is served from memory at the relative path specified in publicPath.

‎app/index.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/**
2+
* Application entry point
3+
*/
4+
5+
// Load application styles
6+
import 'styles/index.scss';
7+
import AddressParse from './lib/address-parse'
8+
import $ from 'jquery'
9+
10+
// ================================
11+
// START YOUR APP HERE
12+
// ================================
13+
14+
const parse = () => {
15+
const onTextAreaBlur = (e) => {
16+
const address = e.target.value
17+
const parseResult = AddressParse(address)
18+
console.log(parseResult)
19+
$('#result').empty();
20+
$('#result').append(`<ul>${Object.entries(parseResult).map(([k, v]) => `<li>${k}${v}</li>`).join('')}</ul>`)
21+
}
22+
$('#addressContent').bind('input propertychange', onTextAreaBlur)
23+
24+
$('#addressList li').on('click', (e) => {
25+
$('#addressContent').val(e.target.innerText)
26+
$('#addressContent')[0].dispatchEvent(new Event('input'));
27+
})
28+
}
29+
30+
parse()

0 commit comments

Comments
 (0)
Please sign in to comment.