1
我叫app.scss
,我想編譯成一個名爲app.css
CSS一個簡單的文件。編譯SASS用的WebPack 3
/web/static/stylesheets/app.scss
Compiles to...
/priv/static/css/app.css
這是我的webpack.config。
常量路徑=需要( 「路徑」);
module.exports = [
{
entry: "./web/static/js/app.js",
output: {
path: path.resolve(__dirname, "priv/static/js"),
filename: "app.js"
},
resolve: {
modules: ["node_modules", __dirname + "/web/static/js"]
},
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: "babel-loader",
query: {
presets: ["env"]
}
}
]
}
},
{
entry: "./web/static/stylesheets/app.scss",
output: {
path: path.resolve(__dirname, "priv/static/css"),
filename: "app.css"
},
resolve: {
modules: ["node_modules"]
},
module: {
loaders: [
{
test: /\.scss$/,
exclude: /node_modules/,
use: [
{
loader: "style-loader"
},
{
loader: "css-loader"
},
{
loader: "sass-loader"
}
]
}
]
}
}
];
的文件編譯沒有錯誤,但裏面app.css內容是不正確。
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
... and so on.
在那裏我錯誤配置的WebPack有什麼建議?