我在从material-ui获取UI的工作中遇到了一些问题。 我一直在寻找互联网和stackoverflow几天来解决我的问题,但我尝试失败的一切。谁能帮我得到这个工作,因为我觉得官方指导不足新秀材质用户界面和反应
在此先感谢
编辑: 对不起,缺乏代码。我意识到我必须运行npm start
才能在当地工作。然而这转移了另一个问题。我如何将其部署到我的网络服务器?服务器正在public_html文件夹中查找索引文件。由于这依赖于webpack或gulp我没有看到我应该如何部署到我的服务器?我必须运行node.js还是? 请询问任何后续问题
的WebPack-production.config.js:
const webpack = require('webpack');
const path = require('path');
const buildPath = path.resolve(__dirname, 'build');
const nodeModulesPath = path.resolve(__dirname, 'node_modules');
const TransferWebpackPlugin = require('transfer-webpack-plugin');
const config = {
entry: [path.join(__dirname, '/src/app/app.js')],
// Render source-map file for final build
devtool: 'source-map',
// output config
output: {
path: buildPath, // Path of output file
filename: 'app.js', // Name of output file
},
plugins: [
// Define production build to allow React to strip out unnecessary checks
new webpack.DefinePlugin({
'process.env':{
'NODE_ENV': JSON.stringify('production')
}
}),
// Minify the bundle
new webpack.optimize.UglifyJsPlugin({
compress: {
// suppresses warnings, usually from module minification
warnings: false,
},
}),
// Allows error warnings but does not stop compiling.
new webpack.NoErrorsPlugin(),
// Transfer Files
new TransferWebpackPlugin([
{from: 'www'},
], path.resolve(__dirname, 'src')),
],
module: {
loaders: [
{
test: /\.js$/, // All .js files
loaders: ['babel-loader'], // react-hot is like browser sync and babel loads jsx and es6-7
exclude: [nodeModulesPath],
},
],
},
};
module.exports = config;
您寻求帮助,但您不解释您的问题...... – olibiaz
问题是什么,先生?与我们分享您想要发生的事情以及造成错误的代码。 –
感谢您的回复。我更新了我的问题 – frisk0