这是我的webpack.config.js
:
var ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
// the main entry of our app
entry: ['./src/index.js', './src/services/auth/index.js','./src/dist/js/drop-down.js'],
// output configuration
output: {
path: __dirname + '/build/',
publicPath: 'build/',
filename: 'build.js'
},
module: {
loaders: [
// process *.vue files using vue-loader
{test: /\.vue$/, loader: 'vue'},
// process *.js files using babel-loader
// the exclude pattern is important so that we don't
// apply babel transform to all the dependencies!
{test: /\.js$/, loader: 'babel', exclude: /node_modules/},
{test: /\.css$/, loader: ExtractTextPlugin.extract("style-loader", "css-loader")}
]
},
plugins: [
new ExtractTextPlugin("styles.css")
],
babel: {
presets: ['es2015'],
plugins: ['transform-runtime']
}
};
我的package.json:
{
"name": "somename",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "somelicense",
"devDependencies": {
"babel-core": "^6.1.2",
"babel-loader": "^6.1.0",
"babel-plugin-transform-runtime": "^6.1.2",
"babel-preset-es2015": "^6.1.2",
"babel-runtime": "^6.0.14",
"css-loader": "^0.21.0",
"extract-text-webpack-plugin": "^1.0.1",
"style-loader": "^0.13.0",
"vue-hot-reload-api": "^1.2.1",
"vue-html-loader": "^1.0.0",
"vue-loader": "^7.0.1",
"webpack": "^1.12.3",
"webpack-dev-server": "^1.12.1"
},
"dependencies": {
"bootstrap": "^3.3.5",
"vue": "^1.0.7",
"vue-resource": "^0.1.17",
"vue-router": "^0.7.5"
}
}
这是我的目录结构:
当我运行webpack服务器时
webpack-dev-server --inline --hot
http://localhost:8080/build/styles.css
有没有办法检查styles.css是否已生成?(可能是/build
以外的其他地方)
如何修复此404错误?