-
Notifications
You must be signed in to change notification settings - Fork 342
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dva-hmr热更新问题 #887
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
开发过程中更新css样式,可正常实现热更新功能,
其他代码的更新则触发重启机制
"roadhog": "^2.5.0-beta.4",
"babel-plugin-dva-hmr": "^0.4.1"
.webpackrc.js文件
const path = require('path');
const env = require('./env');
const pkg = require('./package');
console.log(env);
const define = {
'process.env.APP_NAME': pkg.name,
};
Object.keys(env).forEach(key => {
let obj = {};
obj[
process.env.${key}
] = env[key];Object.assign(define, obj);
});
export default {
entry: 'src/index.js',
extraBabelPlugins: [['import', { libraryName: 'antd', libraryDirectory: 'es', style: true }]],
env: {
development: {
extraBabelPlugins: ['dva-hmr'],
},
},
externals: {
'@antv/data-set': 'DataSet',
// rollbar: 'rollbar',
},
alias: {
components: path.resolve(__dirname, 'src/components/'),
},
ignoreMomentLocale: true,
theme: './src/theme.js',
html: {
template: './src/index.ejs',
},
lessLoaderOptions: {
javascriptEnabled: true,
},
disableDynamicImport: true,
publicPath: process.env.NODE_ENV === 'production' ?
/${pkg.name}/
: '/',hash: true,
define: define,
};
The text was updated successfully, but these errors were encountered: