Last active
April 18, 2016 07:36
-
-
Save codrin-iftimie/65e8c37e8dbea7f9af5a09549156825d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//create this file under node_modules/csjs | |
var getCss = require("csjs/get-css"); | |
var csjs = require("csjs"); | |
var requireFromString = require("require-from-string"); | |
module.exports = function(source) { | |
var parsedSource = requireFromString(source); | |
return getCss(parsedSource.__esModule ? parsedSource.default : parsedSource); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var path = require("path"); | |
var ExtractTextPlugin = require("extract-text-webpack-plugin"); | |
module.exports = { | |
entry: "./index.js", | |
output: { | |
path: path.resolve(__dirname, "assets"), | |
publicPath: "/assets/", | |
filename: "index.js", | |
}, | |
plugins: [ | |
new ExtractTextPlugin("styles.css") | |
], | |
module: { | |
loaders: [ | |
{ | |
test: /\.js?$/, | |
loader: "babel-loader", | |
exclude: /node_modules/, | |
query: { | |
cacheDirectory: true | |
} | |
}, { | |
test: /\.csjs.js?$/, | |
loader: ExtractTextPlugin.extract("css-loader!csjs-loader!babel-loader") | |
} | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment