Skip to content

Commit 9eb9b22

Browse files
committed
webpack setup take 4
1 parent 8476047 commit 9eb9b22

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+8325
-3029
lines changed

.babelrc

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"presets": [
3+
"./.babelrc.js"
4+
]
5+
}

.babelrc.js

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// this file will be used by default by babel@7 once it is released
2+
module.exports = {
3+
"plugins": [
4+
"transform-decorators-legacy",
5+
"transform-class-properties"
6+
],
7+
"presets": [
8+
[
9+
"env", {
10+
"targets": process.env.BABEL_TARGET === 'node' ? {
11+
"node": process.env.IN_PROTRACTOR ? '6' : 'current'
12+
} : {
13+
"browsers": [
14+
"last 2 versions",
15+
"not ie <= 11"
16+
],
17+
"uglify": process.env.NODE_ENV === 'production',
18+
},
19+
"loose": true,
20+
"modules": process.env.BABEL_TARGET === 'node' ? 'commonjs' : false,
21+
"useBuiltIns": true
22+
}
23+
]
24+
]
25+
}

.eslintrc.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "./node_modules/aurelia-tools/.eslintrc.json"
3+
}

.gitignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
node_modules
2+
.DS_STORE
3+
npm-debug.log*
4+
yarn-error.log
5+
/dist
6+
/test/*coverage
7+
/test/coverage*
8+
/.chrome

.yarnrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
save-prefix ""
-17.6 KB
Binary file not shown.

674f50d287a8c48dc19ba404d20fe713.eot

-162 KB
Binary file not shown.

89889688147bd7575d6327160d64e760.svg

-288
This file was deleted.

912ec66d7572ff821749319396470bde.svg

-2,671
This file was deleted.

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Docs

ac6e52c51ed090a1c19661458209af6c.css

-11
This file was deleted.
-75.4 KB
Binary file not shown.

app.963658591675804c168f.bundle.js

-4
This file was deleted.

app.963658591675804c168f.bundle.map

-1
This file was deleted.

b06871f281fee6b241d60582ae9369b9.ttf

-162 KB
Binary file not shown.

common.36b296afad0eb9f25fbd.bundle.js

-26
This file was deleted.

common.36b296afad0eb9f25fbd.bundle.map

-1
This file was deleted.

e18bbf611f2a2e43afc071aa2f4e1512.ttf

-44.3 KB
Binary file not shown.

f4769f9bdb7466be65088239c12046d1.eot

-19.7 KB
Binary file not shown.

fa2772327f55d8198301fdb8bcfc8158.woff

-22.9 KB
Binary file not shown.

fee66e712a8a08eef5805a46892932ad.woff

-95.7 KB
Binary file not shown.

index.ejs

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<title><%- htmlWebpackPlugin.options.metadata.title %></title>
6+
<meta name="viewport" content="width=device-width, initial-scale=1">
7+
<base href="<%- htmlWebpackPlugin.options.metadata.baseUrl %>">
8+
<!-- imported CSS are concatenated and added automatically -->
9+
</head>
10+
<body aurelia-app="main">
11+
<div class="splash">
12+
<div class="message"><%- htmlWebpackPlugin.options.metadata.title %></div>
13+
<i class="fa fa-spinner fa-spin"></i>
14+
</div>
15+
<% if (htmlWebpackPlugin.options.metadata.server) { %>
16+
<!-- Webpack Dev Server reload -->
17+
<script src="/webpack-dev-server.js"></script>
18+
<% } %>
19+
</body>
20+
</html>

index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<!DOCTYPE html><html><head><meta charset="utf-8"><title>Aurelia Navigation Skeleton</title><meta name="viewport" content="width=device-width,initial-scale=1"><base href="/"><link href="/ac6e52c51ed090a1c19661458209af6c.css" rel="stylesheet"></head><body aurelia-app="main"><div class="splash"><div class="message">Aurelia Navigation Skeleton</div><i class="fa fa-spinner fa-spin"></i></div><script type="text/javascript" src="/common.36b296afad0eb9f25fbd.bundle.js"></script><script type="text/javascript" src="/app.963658591675804c168f.bundle.js"></script><script type="text/javascript" src="/vendor.ad5faf899c21e8da7df2.bundle.js"></script></body></html>
1+
<!DOCTYPE html><html><head><meta charset="utf-8"><title>Aurelia Navigation Skeleton</title><meta name="viewport" content="width=device-width,initial-scale=1"><base href=""><link href="/dist/9b84c70f775b4092d32608cecec7b397.css" rel="stylesheet"></head><body aurelia-app="main"><div class="splash"><div class="message">Aurelia Navigation Skeleton</div><i class="fa fa-spinner fa-spin"></i></div><script type="text/javascript" src="/dist/common.1a812a153652ae68ec04.bundle.js"></script><script type="text/javascript" src="/dist/app.963658591675804c168f.bundle.js"></script><script type="text/javascript" src="/dist/vendor.ad5faf899c21e8da7df2.bundle.js"></script></body></html>

jsconfig.json

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"compilerOptions": {
3+
"target": "es2015",
4+
"lib": ["es2017", "dom"],
5+
"experimentalDecorators": true,
6+
"baseUrl": "src"
7+
},
8+
"exclude": [
9+
"node_modules",
10+
"dist"
11+
]
12+
}

package-scripts.js

+99
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
const {series, crossEnv, concurrent, rimraf} = require('nps-utils')
2+
const {config: {port: E2E_PORT}} = require('./test/protractor.conf')
3+
4+
module.exports = {
5+
scripts: {
6+
default: 'nps webpack',
7+
test: {
8+
default: 'nps test.jest',
9+
jest: {
10+
default: series(
11+
rimraf('test/coverage-jest'),
12+
crossEnv('BABEL_TARGET=node jest')
13+
),
14+
accept: crossEnv('BABEL_TARGET=node jest -u'),
15+
watch: crossEnv('BABEL_TARGET=node jest --watch'),
16+
},
17+
karma: {
18+
default: series(
19+
rimraf('test/coverage-karma'),
20+
'karma start test/karma.conf.js'
21+
),
22+
watch: 'karma start test/karma.conf.js --auto-watch --no-single-run',
23+
debug: 'karma start test/karma.conf.js --auto-watch --no-single-run --debug'
24+
},
25+
lint: {
26+
default: 'eslint src',
27+
fix: 'eslint --fix'
28+
},
29+
all: concurrent({
30+
browser: series.nps('test.karma', 'e2e'),
31+
jest: 'nps test.jest',
32+
lint: 'nps test.lint'
33+
})
34+
},
35+
e2e: {
36+
default: concurrent({
37+
webpack: `webpack-dev-server --inline --port=${E2E_PORT}`,
38+
protractor: 'nps e2e.whenReady',
39+
}) + ' --kill-others --success first',
40+
protractor: {
41+
install: 'webdriver-manager update',
42+
default: series(
43+
'nps e2e.protractor.install',
44+
'protractor test/protractor.conf.js'
45+
),
46+
debug: series(
47+
'nps e2e.protractor.install',
48+
'protractor test/protractor.conf.js --elementExplorer'
49+
),
50+
},
51+
whenReady: series(
52+
`wait-on --timeout 120000 http-get://localhost:${E2E_PORT}/index.html`,
53+
'nps e2e.protractor'
54+
),
55+
},
56+
build: 'nps webpack.build',
57+
webpack: {
58+
default: 'nps webpack.server',
59+
build: {
60+
before: rimraf('dist'),
61+
default: 'nps webpack.build.production',
62+
development: {
63+
default: series(
64+
'nps webpack.build.before',
65+
'webpack --progress -d'
66+
),
67+
extractCss: series(
68+
'nps webpack.build.before',
69+
'webpack --progress -d --env.extractCss'
70+
),
71+
serve: series.nps(
72+
'webpack.build.development',
73+
'serve'
74+
),
75+
},
76+
production: {
77+
inlineCss: series(
78+
'nps webpack.build.before',
79+
crossEnv('NODE_ENV=production webpack --progress -p --env.production')
80+
),
81+
default: series(
82+
'nps webpack.build.before',
83+
crossEnv('NODE_ENV=production webpack --progress -p --env.production --env.extractCss')
84+
),
85+
serve: series.nps(
86+
'webpack.build.production',
87+
'serve'
88+
),
89+
}
90+
},
91+
server: {
92+
default: `webpack-dev-server -d --inline --env.server`,
93+
extractCss: `webpack-dev-server -d --inline --env.server --env.extractCss`,
94+
hmr: `webpack-dev-server -d --inline --hot --env.server`
95+
},
96+
},
97+
serve: 'http-server dist --cors',
98+
},
99+
}

package.json

+118
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
{
2+
"name": "malexion.github.io",
3+
"version": "1.0.0",
4+
"description": "Demo/Wiki Site.",
5+
"main": "dist/app.bundle.js",
6+
"author": "Malexion",
7+
"engines": {
8+
"node": ">= 6.0.0"
9+
},
10+
"scripts": {
11+
"start": "nps",
12+
"test": "nps test"
13+
},
14+
"jest": {
15+
"modulePaths": [
16+
"<rootDir>/src",
17+
"<rootDir>/node_modules"
18+
],
19+
"moduleFileExtensions": [
20+
"js",
21+
"json"
22+
],
23+
"transform": {
24+
"^.+\\.jsx?$": "babel-jest"
25+
},
26+
"testRegex": "\\.spec\\.(ts|js)x?$",
27+
"setupFiles": [
28+
"<rootDir>/test/jest-pretest.js"
29+
],
30+
"testEnvironment": "node",
31+
"moduleNameMapper": {
32+
"aurelia-(.*)": "<rootDir>/node_modules/$1"
33+
},
34+
"collectCoverage": true,
35+
"collectCoverageFrom": [
36+
"src/**/*.{js,ts}",
37+
"!**/*.spec.{js,ts}",
38+
"!**/node_modules/**",
39+
"!**/test/**"
40+
],
41+
"coverageDirectory": "<rootDir>/test/coverage-jest",
42+
"coverageReporters": [
43+
"json",
44+
"lcov",
45+
"text",
46+
"html"
47+
]
48+
},
49+
"devDependencies": {
50+
"aurelia-loader-nodejs": "1.0.1",
51+
"aurelia-pal-nodejs": "1.0.0-beta.1.0.0",
52+
"aurelia-protractor-plugin": "1.0.3",
53+
"aurelia-testing": "1.0.0-beta.3.0.1",
54+
"aurelia-tools": "1.0.0",
55+
"aurelia-webpack-plugin": "2.0.0-rc.2",
56+
"autoprefixer": "7.1.2",
57+
"babel-core": "6.25.0",
58+
"babel-eslint": "7.2.3",
59+
"babel-jest": "20.0.3",
60+
"babel-loader": "7.1.1",
61+
"babel-plugin-istanbul": "4.1.4",
62+
"babel-plugin-transform-class-properties": "6.24.1",
63+
"babel-plugin-transform-decorators-legacy": "1.3.4",
64+
"babel-polyfill": "6.23.0",
65+
"babel-preset-env": "1.6.0",
66+
"babel-register": "6.24.1",
67+
"copy-webpack-plugin": "4.0.1",
68+
"cross-env": "5.0.1",
69+
"css-loader": "0.28.4",
70+
"eslint": "3.19.0",
71+
"expose-loader": "0.7.3",
72+
"extract-text-webpack-plugin": "3.0.0",
73+
"file-loader": "0.11.2",
74+
"html-webpack-plugin": "2.29.0",
75+
"http-server": "0.10.0",
76+
"jasmine-core": "2.6.4",
77+
"jest": "20.0.4",
78+
"jest-cli": "20.0.4",
79+
"json-loader": "0.5.4",
80+
"karma": "1.7.0",
81+
"karma-chrome-launcher": "2.2.0",
82+
"karma-coverage": "1.1.1",
83+
"karma-jasmine": "1.1.0",
84+
"karma-mocha-reporter": "2.2.3",
85+
"karma-webpack": "2.0.4",
86+
"nps": "5.6.0",
87+
"nps-utils": "1.2.0",
88+
"postcss-loader": "2.0.6",
89+
"protractor": "5.1.2",
90+
"style-loader": "0.18.2",
91+
"url-loader": "0.5.9",
92+
"wait-on": "2.0.2",
93+
"webpack": "3.3.0",
94+
"webpack-dev-server": "2.5.1"
95+
},
96+
"dependencies": {
97+
"aurelia-bootstrapper": "2.1.1",
98+
"aurelia-fetch-client": "1.1.2",
99+
"aurelia-framework": "1.1.4",
100+
"aurelia-history-browser": "1.0.0",
101+
"aurelia-loader-webpack": "2.1.0",
102+
"aurelia-logging-console": "1.0.0",
103+
"aurelia-pal-browser": "1.2.1",
104+
"aurelia-polyfills": "1.2.2",
105+
"aurelia-router": "1.3.0",
106+
"aurelia-table": "^1.1.3",
107+
"aurelia-templating": "1.4.2",
108+
"aurelia-templating-binding": "1.3.0",
109+
"aurelia-templating-resources": "1.4.0",
110+
"aurelia-templating-router": "1.1.0",
111+
"bluebird": "3.5.0",
112+
"bootstrap": "3.3.7",
113+
"font-awesome": "4.7.0",
114+
"isomorphic-fetch": "2.2.1",
115+
"iterate-js": "^1.1.0",
116+
"jquery": "3.2.1"
117+
}
118+
}

src/app.html

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<template>
2+
<require from="./nav-bar.html"></require>
3+
4+
<nav-bar router.bind="router"></nav-bar>
5+
6+
<div class="page-host">
7+
<router-view></router-view>
8+
</div>
9+
</template>

src/app.js

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { PLATFORM } from 'aurelia-pal';
2+
3+
export class App {
4+
configureRouter(config, router) {
5+
//config.title = 'Malexion';
6+
config.map([
7+
{ route: ['', 'home'], name: 'home', moduleId: PLATFORM.moduleName('./home'), nav: true, title: 'Home' },
8+
{ route: 'aurelia-table', name: 'aurelia-table', moduleId: PLATFORM.moduleName('./aurelia-table/path'), nav: true, title: 'Aurelia Table' }
9+
]);
10+
11+
this.router = router;
12+
}
13+
}

src/aurelia-table/home.html

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<template>
2+
<section class="au-animate">
3+
<div class="col-md-6" style="padding: 10px;">
4+
<div class="row">
5+
<aurelia-table header="My Grid" columns.bind="columns" rows.bind="rows"></aurelia-table>
6+
</div>
7+
</div>
8+
</section>
9+
</template>

src/aurelia-table/home.js

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
import __ from 'iterate-js';
3+
4+
export class Welcome {
5+
6+
columns = [
7+
{ field: 'name', header: 'Name' },
8+
{ field: 'value', header: 'Value' },
9+
];
10+
rows = __.map(100, x => ({ name: 'fred', value: x }));
11+
12+
}

src/aurelia-table/path.html

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<template>
2+
<div class="col-md-2" style="padding: 10px; margin: 0px;">
3+
<div class="well">
4+
<ul class="nav nav-pills nav-stacked">
5+
<li repeat.for="row of router.navigation" class="${row.isActive ? 'active' : ''}">
6+
<a href.bind="row.href">${row.title}</a>
7+
</li>
8+
</ul>
9+
</div>
10+
</div>
11+
<div class="col-md-10" style="padding: 10px; margin: 0px;">
12+
<router-view></router-view>
13+
</div>
14+
</template>

src/aurelia-table/path.js

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { PLATFORM } from 'aurelia-pal';
2+
3+
export class App {
4+
configureRouter(config, router) {
5+
//config.title = 'Malexion';
6+
config.map([
7+
{ route: ['', 'home'], name: 'home', moduleId: PLATFORM.moduleName('./home'), nav: true, title: 'Home' },
8+
//{ route: 'aurelia-table', name: 'aurelia-table', moduleId: PLATFORM.moduleName('./aurelia-table/path'), nav: true, title: 'Aurelia Table' }
9+
]);
10+
11+
this.router = router;
12+
}
13+
}

src/home.html

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<template>
2+
3+
</template>

src/home.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
export class Welcome {
3+
constructor() {
4+
5+
}
6+
}

0 commit comments

Comments
 (0)