Upgrade webpack to version v4.x (#6655)
parent
e709107463
commit
e9b322d0a6
@ -0,0 +1,8 @@
|
||||
import Rails from 'rails-ujs';
|
||||
|
||||
export function start() {
|
||||
require('font-awesome/css/font-awesome.css');
|
||||
require.context('../images/', true);
|
||||
|
||||
Rails.start();
|
||||
};
|
@ -1,6 +0,0 @@
|
||||
import { start } from 'rails-ujs';
|
||||
import 'font-awesome/css/font-awesome.css';
|
||||
|
||||
require.context('../images/', true);
|
||||
|
||||
start();
|
@ -1,15 +1,22 @@
|
||||
const ExtractTextPlugin = require('extract-text-webpack-plugin');
|
||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
||||
const { env } = require('../configuration.js');
|
||||
|
||||
module.exports = {
|
||||
test: /\.(scss|sass|css)$/i,
|
||||
use: ExtractTextPlugin.extract({
|
||||
fallback: 'style-loader',
|
||||
use: [
|
||||
{ loader: 'css-loader', options: { minimize: env.NODE_ENV === 'production' } },
|
||||
{ loader: 'postcss-loader', options: { sourceMap: true } },
|
||||
'resolve-url-loader',
|
||||
'sass-loader',
|
||||
],
|
||||
}),
|
||||
test: /\.s?css$/i,
|
||||
use: [
|
||||
MiniCssExtractPlugin.loader,
|
||||
{
|
||||
loader: 'css-loader',
|
||||
options: {
|
||||
minimize: env.NODE_ENV === 'production',
|
||||
},
|
||||
},
|
||||
{
|
||||
loader: 'postcss-loader',
|
||||
options: {
|
||||
sourceMap: true,
|
||||
},
|
||||
},
|
||||
'sass-loader',
|
||||
],
|
||||
};
|
||||
|
Loading…
Reference in new issue