output: { filename: 'bundle.js', //this is the default name, so you can skip it //at this directory our bundle file will be available //make sure port 8090 is used when launching webpack-dev-server publicPath: 'http://localhost:8090/assets'//重点在这里 },
3,安装 http-server
1
npm install --save-dev http-server
4,页面添加启动脚本
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
<!DOCTYPE html> <html> <head> <title>Basic Property Grid</title> <!-- include react --> <scriptsrc="./node_modules/react/dist/react-with-addons.js"></script> </head> <body> <divid="content"> <!-- this is where the root react component will get rendered --> </div> <!-- include the webpack-dev-server script so our scripts get reloaded when we make a change --> <!-- we'll run the webpack dev server on port 8090, so make sure it is correct --> <scriptsrc="http://localhost:8090/webpack-dev-server.js"></script> <!-- include the bundle that contains all our scripts, produced by webpack --> <!-- the bundle is served by the webpack-dev-server, so serve it also from localhost:8090 --> <scripttype="text/javascript"src="http://localhost:8090/assets/bundle.js"></script> </body> </html>
// index.js // javascript require('./a'); let People = require('./es6-module'); let p = new People("Yika"); p.sayHi(); // css require('./css/main.scss');
>>> from walkerfree import config >>> from walkerfree import app >>> app.config.from_object(config['development']) >>> from walkerfree import db >>> db.init_app(app) >>> db <SQLAlchemy engine='mysql+mysqldb://root:@127.0.0.1/walkerfree?charset=utf8'> >>> db.create_all()