Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/478.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 使用Webpack和React创建一个2页的网站(index.html和another.html)_Javascript_Reactjs_Webpack_Babeljs - Fatal编程技术网

Javascript 使用Webpack和React创建一个2页的网站(index.html和another.html)

Javascript 使用Webpack和React创建一个2页的网站(index.html和another.html),javascript,reactjs,webpack,babeljs,Javascript,Reactjs,Webpack,Babeljs,我想设置一个两页的网页(从长远来看是多页的,但本例中只有两页)。第一页看起来像这张图片,只是有一个链接,上面写着“点击我”。当你点击这个链接时,它会把你带到第二个网页,上面写着“Hello World” 我可以让一个网站的一页工作的网页。它使用这个webpack.config.js文件 webpack.config.js const webpack=require('webpack'); const HtmlWebpackPlugin=require('html-webpack-plugin

我想设置一个两页的网页(从长远来看是多页的,但本例中只有两页)。第一页看起来像这张图片,只是有一个链接,上面写着“点击我”。当你点击这个链接时,它会把你带到第二个网页,上面写着“Hello World”

我可以让一个网站的一页工作的网页。它使用这个webpack.config.js文件

webpack.config.js

const webpack=require('webpack');
const HtmlWebpackPlugin=require('html-webpack-plugin');
const HtmlWebpackTemplate=require('html-webpack-template');
const path=require('path');
常量配置={
条目:{
索引:'./src/index.js'
},
输出:{
path:path.resolve(uu dirname,'./dist'),
文件名:“bundle.js”,
},
模块:{
规则:[
{
测试:/\(js|jsx)$/,
使用“babel loader”,
排除:/node_模块/,
},
],
},
决心:{
扩展:['.js','.jsx'],
}
};

module.exports=config在条目中应该是这样的:

entry: {
    index: './src/index.js',
    services: './src/services.js'
  },