Permalink
Browse files

webpack api

  • Loading branch information...
LoeiFy committed Dec 20, 2017
1 parent 90ff7db commit d0d3714b097f9b56cb9991e8b0f04082714bf6e9
Showing with 48 additions and 0 deletions.
  1. +14 −0 .editorconfig
  2. +3 −0 .eslintignore
  3. +10 −0 .eslintrc
  4. +3 −0 package.json
  5. +18 −0 test/index.js
View
@@ -0,0 +1,14 @@
root = true
[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.{md,markdown}]
trim_trailing_whitespace = false
[*.js]
indent_style = space
indent_size = 2
View
@@ -0,0 +1,3 @@
config.js
config.sample.js
promise.js
View
@@ -0,0 +1,10 @@
{
"extends": "airbnb-base",
"root": true,
"env": {
"browser": true
},
"rules": {
"semi": [2, "never"]
}
}
View
@@ -8,7 +8,10 @@
},
"scripts": {
"start": "webpack-dev-server --inline --hot --port 1234",
"test": "npm run test:lint && npm run test:cover",
"test:lint": "eslint ./src",
"test:unit": "mocha --reporter dot --require intelli-espower-loader ./test",
"test:cover": "istanbul cover --print both _mocha ./test",
"prebuild": "rm -f -R dist",
"build": "cross-env NODE_ENV=production webpack --hide-modules --progress --colors",
"postbuild": "cp src/assets/favicon.ico src/assets/promise.js dist && node bin/zip.js && cd dist && mv index.npm.html index.html"
View
@@ -0,0 +1,18 @@
const assert = require('power-assert')
const pathFn = require('path')
const puppeteer = require('puppeteer')
const webpack = require('webpack')
const WebpackDevServer = require('webpack-dev-server')
const webpackConfig = require('../webpack.config')
const compiler = webpack(webpackConfig)
const devServerOptions = Object.assign({}, webpackConfig.devServer)
const server = new WebpackDevServer(compiler, devServerOptions)
server.listen(1234, '127.0.0.1', () => {
console.log('Server on http://127.0.0.1:1234')
})
// const browser = await puppeteer.launch({ headless: false })
// const page = await browser.newPage()
// await page.goto('http://127.0.0.1:1234')

0 comments on commit d0d3714

Please sign in to comment.