Add webpack

everything's broken
box-drawing
cpsdqs 7 years ago
parent e016fc9a3a
commit 540c93a4bd
Signed by untrusted user: cpsdqs
GPG Key ID: 3F59586BB7448DD1
  1. 4
      .eslintrc
  2. 6
      js/appcommon.js
  3. 17
      js/index.js
  4. 2
      js/lib/chibi.js
  5. 4
      package.json
  6. 21
      webpack.config.js
  7. 839
      yarn.lock

@ -126,7 +126,7 @@
"no-this-before-super": "error",
"no-throw-literal": "error",
"no-trailing-spaces": "off",
"no-undef": "off",
"no-undef": "warn",
"no-undef-init": "error",
"no-unexpected-multiline": "error",
"no-unmodified-loop-condition": "error",
@ -135,7 +135,7 @@
"no-unsafe-finally": "error",
"no-unsafe-negation": "error",
"no-unused-expressions": ["warn", { "allowShortCircuit": true, "allowTernary": true, "allowTaggedTemplates": true }],
"no-unused-vars": ["off", { "vars": "local", "args": "none", "ignoreRestSiblings": true }],
"no-unused-vars": ["error", { "vars": "local", "args": "none", "ignoreRestSiblings": true }],
"no-use-before-define": ["error", { "functions": false, "classes": false, "variables": false }],
"no-useless-call": "error",
"no-useless-computed-key": "error",

@ -1,3 +1,5 @@
const $ = require('./lib/chibi')
/** Global generic init */
$.ready(function () {
// Checkbox UI (checkbox CSS and hidden input with int value)
@ -75,9 +77,9 @@ $.ready(function () {
// populate the form errors box from GET arg ?err=...
// (a way to pass errors back from server via redirect)
let errAt = location.search.indexOf('err=')
let errAt = window.location.search.indexOf('err=')
if (errAt !== -1 && qs('.Box.errors')) {
let errs = location.search.substr(errAt + 4).split(',')
let errs = window.location.search.substr(errAt + 4).split(',')
let humanReadableErrors = []
errs.forEach(function (er) {
let lbl = qs('label[for="' + er + '"]')

@ -0,0 +1,17 @@
require('./lib/chibi')
require('./lib/polyfills')
require('./event_emitter')
require('./utils')
require('./modal')
require('./notif')
require('./appcommon')
require('./demo')
require('./lang')
require('./wifi')
require('./term_conn')
require('./term_input')
require('./term_screen')
require('./term_upload')
require('./debug_screen')
require('./soft_keyboard')
require('./term')

@ -699,5 +699,5 @@
};
// Set Chibi's global namespace here ($)
w.$ = chibi;
module.exports = chibi;
}());

@ -5,10 +5,12 @@
"license": "MPL-2.0",
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-minify": "^0.2.0",
"babel-preset-env": "^1.6.0",
"node-sass": "^4.5.3",
"standard": "^10.0.3"
"standard": "^10.0.3",
"webpack": "^3.6.0"
},
"scripts": {
"babel": "babel $@",

@ -0,0 +1,21 @@
const { execSync } = require('child_process')
const path = require('path')
let hash = execSync('git rev-parse --short HEAD').toString().trim()
module.exports = {
entry: './js',
output: {
path: path.resolve(__dirname, 'out', 'js'),
filename: `app.${hash}.js`
},
module: {
rules: [
{
test: /\.js$/,
loader: 'babel-loader'
}
]
},
devtool: 'source-map'
}

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save