我有一个eslint的问题,它给了我[解析错误关键字导入是保留]这只发生在sublime,在原子编辑器工作得很好.我有意见
.eslintrc.js
module.exports = {
"extends": "airbnb",
"plugins": [
"react"
]
};
Run Code Online (Sandbox Code Playgroud)
的package.json
{
"name": "paint",
"version": "0.0.0",
"description": "paint on the browser",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [
"paint",
"javascript"
],
"author": "",
"license": "ISC",
"devDependencies": {
"browserify": "^11.2.0",
"eslint": "^2.2.0",
"eslint-config-airbnb": "^2.1.1",
"eslint-plugin-react": "^3.11.2",
"gulp-babel": "^5.2.1",
"gulp-clean": "^0.3.1",
"gulp-stylus": "^2.2.0",
"vinyl-source-stream": "^1.1.0"
}
}
Run Code Online (Sandbox Code Playgroud) 当我改变我app.js和main.css同时webpack-dev-server运行时,包被更新。但是当我更改index.html内容时不会刷新;如果我向 HTML 添加一行,webpack-dev-server则不会刷新页面上的任何内容。这是我的webpack.config.js和package.json文件。我希望你能帮助我。
webpack.config.js :
var webpack = require('webpack');
var WebpackDevServer = require('webpack-dev-server');
var CleanWebpackPlugin = require('clean-webpack-plugin');
var chalk = require('chalk');
var env = process.env.WEBPACK_ENV;
var host = 'localhost';
var port = '8080';
var config = {
devtool: 'source-map',
entry: [
'webpack/hot/dev-server',
'webpack-dev-server/client?http://' + host + ':' + port +'/',
'./src/app.js'
],
output: {
path: __dirname + '/dist',
filename: 'bundle.js'
},
module : {
loaders: [ …Run Code Online (Sandbox Code Playgroud) javascript webpack webpack-dev-server webpack-hmr html-webpack-plugin