Skip to content
Open
Show file tree
Hide file tree
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
16 changes: 2 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,9 @@
sudo: false
language: node_js
node_js:
- 4
- 6
- 8
env:
- USE_WEBPACK2=false
- USE_WEBPACK2=true
matrix:
exclude:
# TODO: Fix barf on peer dependencies with npm@2.
- env: USE_WEBPACK2=true
node_js: 4

before_install:
- 'if [ "${USE_WEBPACK2}" == "true" ]; then npm install --save-dev webpack@2.1.0-beta.19 extract-text-webpack-plugin@2.0.0-beta.4; fi'

- 10
- 12
after_script:
- npm install coveralls
- cat ./coverage/coverage.json | ./node_modules/.bin/adana --format lcov | ./node_modules/coveralls/bin/coveralls.js
30 changes: 20 additions & 10 deletions example/basic/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var CSSSplitWebpackPlugin = require('../../').default;
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const CSSSplitWebpackPlugin = require('../../').default;

const miniCssConfig = {
loader: MiniCssExtractPlugin.loader,
options: {
// you can specify a publicPath here
// by default it uses publicPath in webpackOptions.output
publicPath: '../',
hmr: process.env.NODE_ENV === 'development',
},
};

module.exports = {
entry: './index.js',
Expand All @@ -10,19 +20,19 @@ module.exports = {
filename: 'bundle.js',
},
module: {
loaders: [{
rules: [{
test: /\.css$/,
loader: ExtractTextPlugin.extract.length !== 1 ?
ExtractTextPlugin.extract('style-loader', 'css-loader') :
ExtractTextPlugin.extract({
fallbackLoader: 'style-loader',
loader: 'css-loader',
}),
use: [
miniCssConfig,
'css-loader',
],
}],
},
devtool: 'source-map',
plugins: [
new ExtractTextPlugin("styles.css"),
new MiniCssExtractPlugin({
filename: 'styles.css',
}),
new CSSSplitWebpackPlugin({size: 3, imports: true}),
],
};
28 changes: 21 additions & 7 deletions example/less/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var CSSSplitWebpackPlugin = require('../../').default;
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const CSSSplitWebpackPlugin = require('../../').default;

const miniCssConfig = {
loader: MiniCssExtractPlugin.loader,
options: {
// you can specify a publicPath here
// by default it uses publicPath in webpackOptions.output
publicPath: '../',
hmr: process.env.NODE_ENV === 'development',
},
};

module.exports = {
entry: './index.js',
Expand All @@ -10,16 +20,20 @@ module.exports = {
filename: 'bundle.js',
},
module: {
loaders: [{
rules: [{
test: /\.less$/,
loader: ExtractTextPlugin.extract(
'css?-url&-autoprefixer&sourceMap!less?sourceMap'
),
use: [
miniCssConfig,
'css-loader',
'less-loader',
],
}],
},
devtool: 'source-map',
plugins: [
new ExtractTextPlugin("styles.css"),
new MiniCssExtractPlugin({
filename: 'styles.css',
}),
new CSSSplitWebpackPlugin({size: 3}),
],
};
Loading