Skip to content

Commit

Permalink
Build project
Browse files Browse the repository at this point in the history
  • Loading branch information
Dafrok committed Apr 17, 2017
1 parent 3bab7d4 commit 29bbb0a
Show file tree
Hide file tree
Showing 9 changed files with 130 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .babelrc
@@ -0,0 +1,3 @@
{
"presets": ["es2015"]
}
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -35,3 +35,6 @@ jspm_packages

# Optional REPL history
.node_repl_history

# distribut
dist
28 changes: 28 additions & 0 deletions build/webpack.dev.config.js
@@ -0,0 +1,28 @@
const path = require('path')
const webpack = require('webpack')
const HtmlWebpackPlugin = require('html-webpack-plugin')

module.exports = {
context: path.resolve(__dirname, '../src'),
entry: './entry.js',
output: {
path: path.resolve(__dirname, '../dist'),
filename: 'index.js'
},
module: {
rules: [
{
test: /\.san$/,
loader: 'san-loader',
},
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/
},
]
},
plugins: [
new HtmlWebpackPlugin()
]
}
39 changes: 39 additions & 0 deletions package.json
@@ -0,0 +1,39 @@
{
"name": "hankana",
"version": "1.0.0",
"private": true,
"description": "Translate chinese charactor to japanese kana.",
"main": "index.js",
"scripts": {
"dev": "webpack-dev-server --content-base dist --config ./build/webpack.dev.config.js --hot --inline",
"build": "webpack -p --config ./build/webpack.dev.config.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Elite-Four/hankana.git"
},
"author": "Dafrok <o.o@mug.dog>",
"license": "MIT",
"bugs": {
"url": "https://github.com/Elite-Four/hankana/issues"
},
"homepage": "https://github.com/Elite-Four/hankana#readme",
"devDependencies": {
"babel-core": "^6.24.1",
"babel-loader": "^6.4.1",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-es2015": "^6.24.1",
"babel-runtime": "^6.23.0",
"css-loader": "^0.25.0",
"html-loader": "^0.4.5",
"html-webpack-plugin": "^2.28.0",
"san-loader": "0.0.3",
"style-loader": "^0.13.2",
"webpack": "^2.4.1",
"webpack-dev-server": "^2.4.2"
},
"dependencies": {
"san": "^3.0.3-rc.23",
"san-router": "^1.0.2"
}
}
21 changes: 21 additions & 0 deletions src/components/App.san
@@ -0,0 +1,21 @@
<template>
<div>
<router-link to="/wd/河曲智叟">合合合</router-link>
<text-field></text-field>
<result-panel></result-panel>
</div>
</template>

<script>
import ResultPanel from './ResultPanel.san'
import TextField from './TextField.san'
import {Link} from 'san-router'

export default {
components: {
'router-link': Link,
'result-panel': ResultPanel,
'text-field': TextField
}
}
</script>
16 changes: 16 additions & 0 deletions src/components/ResultPanel.san
@@ -0,0 +1,16 @@
<template>
<div>
<input value="{= name =}">
<p>{{name}}</p>
</div>
</template>

<script>
export default {
initData: function () {
return {
name: 'foo'
}
}
}
</script>
Empty file added src/components/TextField.san
Empty file.
20 changes: 20 additions & 0 deletions src/entry.js
@@ -0,0 +1,20 @@
import san from 'san'
import App from './components/App.san'
import TextField from './components/TextField.san'
import {router, Link} from 'san-router'

router.setMode('hash')

router.add({
rule: '/',
Component: App,
target: 'body'
});

router.add({
rule: '/wd/:word',
Component: App,
target: 'body'
});

router.start();
File renamed without changes.

0 comments on commit 29bbb0a

Please sign in to comment.