Skip to content

Commit

Permalink
fix: Fixed jq-web import
Browse files Browse the repository at this point in the history
  • Loading branch information
kantord committed Apr 12, 2018
1 parent 751e7bc commit 1cb373a
Show file tree
Hide file tree
Showing 6 changed files with 118 additions and 120 deletions.
221 changes: 109 additions & 112 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"lint:fix": "eslint src --fix",
"coverage": "cross-env NODE_ENV=test nyc --reporter=lcov --reporter=text npm run test",
"analyze": "webpack --profile --json > stats.json",
"manual-test": "webpack-dev-server './src/manual_test.js' --hot --inline --output-filename 'test.js'",
"manual-test": "webpack-dev-server --webpack-config webpack.test.config.js './src/manual_test.js' --hot --inline --output-filename 'test.js'",
"semantic-release": "semantic-release",
"test:e2e": "webpack src/manual_test.js --output-filename test.js --config webpack.config.js && mocha-webpack \"src/e2e-test.js\" --timeout 80000 --webpack-config webpack.test.config.js --require babel-polyfill"
},
Expand Down Expand Up @@ -51,7 +51,7 @@
"fake-style-loader": "^1.0.1",
"file-loader": "^1.1.8",
"hard-source-webpack-plugin": "^0.6.0",
"html-webpack-plugin": "^2.30.1",
"html-webpack-plugin": "^3.2.0",
"inject-loader": "^4.0.1",
"js-yaml": "^3.10.0",
"jsdoc": "^3.5.5",
Expand Down
5 changes: 3 additions & 2 deletions src/jq-web.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@

const jq = async (...args) => {
const jq_ = await import(/* webpackChunkName: "jq" */ 'jq-web')
return jq_(...args)
const jq_ = await import(/* webpackChunkName: "jq-web" */ 'jq-web')
console.log(jq_) // eslint-disable-line
return jq_.default(...args)
}

export default jq
4 changes: 2 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ module.exports = {
compress: true,
port: 9000
},
entry: './src/index.js',
entry: ["babel-polyfill", './src/index.js'],
target: 'web',
mode: 'production',
mode: 'development',
node: {
fs: 'empty'
},
Expand Down
2 changes: 1 addition & 1 deletion webpack.screenshot.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const path = require('path');
const nodeExternals = require('webpack-node-externals');

module.exports = {
entry: './src/index.js',
entry: ["babel-polyfill", './src/index.js'],
target: 'web',
devtool: 'source-map',
mode: 'development',
Expand Down
2 changes: 1 addition & 1 deletion webpack.test.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const path = require('path');
const nodeExternals = require('webpack-node-externals');

module.exports = {
entry: './src/index.js',
entry: ["babel-polyfill", './src/index.js'],
target: 'node',
mode: 'development',
externals: [nodeExternals()],
Expand Down

0 comments on commit 1cb373a

Please sign in to comment.