We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
开发过程中更新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); });
process.env.${key}
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, };
/${pkg.name}/
The text was updated successfully, but these errors were encountered:
No branches or pull requests
开发过程中更新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: