bundlify everything
This commit is contained in:
parent
985e1562ef
commit
1307a2b85d
@ -39,13 +39,6 @@
|
|||||||
<p>Ported to ES6 by <a href="https://twitter.com/kentcdodds">Kent C. Dodds</a></p>
|
<p>Ported to ES6 by <a href="https://twitter.com/kentcdodds">Kent C. Dodds</a></p>
|
||||||
<p>Part of <a href="http://todomvc.com">TodoMVC</a></p>
|
<p>Part of <a href="http://todomvc.com">TodoMVC</a></p>
|
||||||
</footer>
|
</footer>
|
||||||
<script src="src/helpers.js"></script>
|
|
||||||
<script src="src/store.js"></script>
|
|
||||||
<script src="src/model.js"></script>
|
|
||||||
<script src="src/template.js"></script>
|
|
||||||
<script src="src/view.js"></script>
|
|
||||||
<script src="src/controller.js"></script>
|
|
||||||
<script src="src/app.js"></script>
|
|
||||||
<script src="dist/bundle.js"></script>
|
<script src="dist/bundle.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
10
src/app.js
10
src/app.js
@ -1,7 +1,13 @@
|
|||||||
/* global app, log */
|
/* global app, log */
|
||||||
(function(window) {
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
|
require('./view')
|
||||||
|
require('./helpers')
|
||||||
|
require('./controller')
|
||||||
|
require('./model')
|
||||||
|
require('./store')
|
||||||
|
require('./template')
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets up a brand new Todo list.
|
* Sets up a brand new Todo list.
|
||||||
*
|
*
|
||||||
@ -21,8 +27,6 @@
|
|||||||
log('view set')
|
log('view set')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Export to window
|
// Export to window
|
||||||
window.app = window.app || {}
|
window.app = window.app || {}
|
||||||
window.app.onLoad = onLoad
|
window.app.onLoad = onLoad
|
||||||
})(window)
|
|
||||||
|
|||||||
5
src/bootstrap.js
vendored
5
src/bootstrap.js
vendored
@ -1,7 +1,8 @@
|
|||||||
/* global app, $on */
|
/* global app, $on */
|
||||||
(function(window) {
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
|
require('./app')
|
||||||
|
require('./helpers')
|
||||||
|
|
||||||
$on(window, 'load', app.onLoad)
|
$on(window, 'load', app.onLoad)
|
||||||
$on(window, 'hashchange', app.onLoad)
|
$on(window, 'hashchange', app.onLoad)
|
||||||
})(window)
|
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
(function(window) {
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -265,4 +264,3 @@
|
|||||||
// Export to window
|
// Export to window
|
||||||
window.app = window.app || {}
|
window.app = window.app || {}
|
||||||
window.app.Controller = Controller
|
window.app.Controller = Controller
|
||||||
})(window)
|
|
||||||
|
|||||||
@ -1,5 +1,3 @@
|
|||||||
/*global NodeList */
|
|
||||||
(function(window) {
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
// Get element(s) by CSS selector:
|
// Get element(s) by CSS selector:
|
||||||
@ -11,7 +9,6 @@
|
|||||||
return (scope || document).querySelectorAll(selector)
|
return (scope || document).querySelectorAll(selector)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
window.log = function log() {
|
window.log = function log() {
|
||||||
if (window.console && window.console.log) {
|
if (window.console && window.console.log) {
|
||||||
window.console.log.apply(window.console, arguments) // eslint-disable-line
|
window.console.log.apply(window.console, arguments) // eslint-disable-line
|
||||||
@ -79,4 +76,3 @@
|
|||||||
// Allow for looping on nodes by chaining:
|
// Allow for looping on nodes by chaining:
|
||||||
// qsa('.foo').forEach(function () {})
|
// qsa('.foo').forEach(function () {})
|
||||||
NodeList.prototype.forEach = Array.prototype.forEach
|
NodeList.prototype.forEach = Array.prototype.forEach
|
||||||
})(window)
|
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
(function(window) {
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -119,4 +118,3 @@
|
|||||||
// Export to window
|
// Export to window
|
||||||
window.app = window.app || {}
|
window.app = window.app || {}
|
||||||
window.app.Model = Model
|
window.app.Model = Model
|
||||||
})(window)
|
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
(function(window) {
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -141,4 +140,3 @@
|
|||||||
// Export to window
|
// Export to window
|
||||||
window.app = window.app || {}
|
window.app = window.app || {}
|
||||||
window.app.Store = Store
|
window.app.Store = Store
|
||||||
})(window)
|
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
(function(window) {
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
var htmlEscapes = {
|
var htmlEscapes = {
|
||||||
@ -109,4 +108,3 @@
|
|||||||
// Export to window
|
// Export to window
|
||||||
window.app = window.app || {}
|
window.app = window.app || {}
|
||||||
window.app.Template = Template
|
window.app.Template = Template
|
||||||
})(window)
|
|
||||||
|
|||||||
@ -1,7 +1,5 @@
|
|||||||
/*global qs, qsa, $on, $parent, $delegate */
|
/*global qs, qsa, $on, $parent, $delegate */
|
||||||
/* eslint no-invalid-this: 0 */
|
/* eslint no-invalid-this: 0 */
|
||||||
|
|
||||||
(function(window) {
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -217,4 +215,3 @@
|
|||||||
// Export to window
|
// Export to window
|
||||||
window.app = window.app || {}
|
window.app = window.app || {}
|
||||||
window.app.View = View
|
window.app.View = View
|
||||||
})(window)
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@ const webpackValidator = require('webpack-validator')
|
|||||||
const {getIfUtils} = require('webpack-config-utils')
|
const {getIfUtils} = require('webpack-config-utils')
|
||||||
|
|
||||||
module.exports = env => {
|
module.exports = env => {
|
||||||
const {ifProd} = getIfUtils(env)
|
const {ifProd, ifNotProd} = getIfUtils(env)
|
||||||
const config = webpackValidator({
|
const config = webpackValidator({
|
||||||
context: resolve('src'),
|
context: resolve('src'),
|
||||||
entry: './bootstrap.js',
|
entry: './bootstrap.js',
|
||||||
@ -12,6 +12,7 @@ module.exports = env => {
|
|||||||
filename: 'bundle.js',
|
filename: 'bundle.js',
|
||||||
path: resolve('dist'),
|
path: resolve('dist'),
|
||||||
publicPath: '/dist/',
|
publicPath: '/dist/',
|
||||||
|
pathinfo: ifNotProd(),
|
||||||
},
|
},
|
||||||
devtool: ifProd('source-map', 'eval'),
|
devtool: ifProd('source-map', 'eval'),
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user