Skip to content

Commit

Permalink
feat: disableHostCheck and root import (#928)
Browse files Browse the repository at this point in the history
* feat: support host binding in dev

* feat: enable root import

* revert: disablehostcheck
  • Loading branch information
chenjun1011 authored and wssgcg1213 committed Feb 14, 2019
1 parent aca7287 commit 5160fd1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/rax-scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"autoprefixer": "^9.4.3",
"babel-core": "^7.0.0-bridge.0",
"babel-loader": "8.0.4",
"babel-plugin-root-import": "^6.1.0",
"babel-plugin-transform-jsx-stylesheet": "0.6.5",
"camelcase": "^5.0.0",
"case-sensitive-paths-webpack-plugin": "^2.1.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ const {
styleResolver
} = require('miniapp-webpack-plugin');

// Babel plugin to add the opportunity to use import and require with root based paths.
babelConfig.plugins.push([
require.resolve('babel-plugin-root-import'),
{
rootPathPrefix: '/',
},
]);

const babelLoaderConfig = {
loader: require.resolve('babel-loader'),
options: babelConfig,
Expand Down

0 comments on commit 5160fd1

Please sign in to comment.