Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix path issue on windows, when mix "/" and "\" with css-loader #20

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions webpack.make.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ var webpack = require('webpack')
var autoprefixer = require('autoprefixer')
var HtmlWebpackPlugin = require('html-webpack-plugin')
var ExtractTextPlugin = require('extract-text-webpack-plugin')
var path = require('path')

/**
* Make webpack config
Expand Down Expand Up @@ -57,7 +58,7 @@ module.exports = function makeWebpackConfig (options) {
} else {
config.output = {
// Absolute output directory
path: __dirname + '/public',
path: path.join(__dirname, 'public'),

// Output path from the view of the page
// Uses webpack-dev-server in development
Expand Down Expand Up @@ -177,7 +178,7 @@ module.exports = function makeWebpackConfig (options) {
// Allow loading css through js and getting the className
var localCssLoader = {
test: /\.css$/,
include: __dirname + '/app',
include: path.join(__dirname, 'app'),
// Reference: https://github.com/webpack/extract-text-webpack-plugin
// Extract css files in production builds
loader: ExtractTextPlugin.extract(
Expand All @@ -195,7 +196,7 @@ module.exports = function makeWebpackConfig (options) {
// The same as localCssLoader, but imports are globals
var globalCssLoader = {
test: /\.css$/,
include: __dirname + '/node_modules',
include: path.join(__dirname, 'node_modules'),
loader: ExtractTextPlugin.extract('style', 'css?sourceMap!postcss')
}

Expand Down