mirror of
https://github.com/webslides/WebSlides.git
synced 2025-08-17 18:37:00 +02:00
Refactor web pack configuration and remove webpack.config.babel because you are not using import A form ‘b’
This commit is contained in:
@@ -35,6 +35,7 @@
|
||||
"babel-preset-es2015": "^6.22.0",
|
||||
"css-loader": "^0.26.2",
|
||||
"extract-text-webpack-plugin": "^2.1.0",
|
||||
"node-sass": "^4.5.0",
|
||||
"npm-run-all": "^4.0.2",
|
||||
"postcss-loader": "^1.3.3",
|
||||
"rimraf": "^2.6.0",
|
||||
@@ -47,8 +48,8 @@
|
||||
"scripts": {
|
||||
"prebuild": "rimraf static/js/webslide*",
|
||||
"build": "npm-run-all --parallel build:*",
|
||||
"build:main": "webpack",
|
||||
"build:main.min": "webpack --output-filename [name].min.js -p --config ./webpack.config.prod.babel.js",
|
||||
"build:main": "webpack --config ./webpack.config.dev.js",
|
||||
"build:main.min": "webpack --output-filename [name].min.js -p --config ./webpack.config.prod.js",
|
||||
"dev": "webpack-dev-server"
|
||||
},
|
||||
"babel": {
|
||||
|
3268
static/css/webslides.css
Normal file
3268
static/css/webslides.css
Normal file
File diff suppressed because it is too large
Load Diff
1
static/css/webslides.min.css
vendored
Normal file
1
static/css/webslides.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
3
static/js/webslides.min.js
vendored
3
static/js/webslides.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -1,4 +1,3 @@
|
||||
const ExtractTextPlugin = require('extract-text-webpack-plugin');
|
||||
const path = require('path');
|
||||
|
||||
const src = path.join(__dirname, 'src');
|
||||
@@ -17,24 +16,13 @@ module.exports = {
|
||||
contentBase: __dirname,
|
||||
host: '0.0.0.0'
|
||||
},
|
||||
devtool: 'inline-source-map',
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.js$/,
|
||||
loader: 'babel-loader',
|
||||
include: src
|
||||
},
|
||||
{
|
||||
test: /\.scss$/,
|
||||
use: ExtractTextPlugin.extract({
|
||||
fallback: 'style-loader',
|
||||
use: 'css-loader?url=false!postcss-loader!sass-loader?sourceMap'
|
||||
}),
|
||||
}
|
||||
]
|
||||
},
|
||||
plugins: [
|
||||
new ExtractTextPlugin("../css/webslides.css")
|
||||
]
|
||||
}
|
||||
};
|
22
webpack.config.dev.js
Normal file
22
webpack.config.dev.js
Normal file
@@ -0,0 +1,22 @@
|
||||
const merge = require('webpack-merge');
|
||||
const ExtractTextPlugin = require('extract-text-webpack-plugin');
|
||||
|
||||
let dev = {
|
||||
devtool: 'inline-source-map',
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.scss$/,
|
||||
use: ExtractTextPlugin.extract({
|
||||
fallback: 'style-loader',
|
||||
use: 'css-loader?url=false!postcss-loader!sass-loader?sourceMap'
|
||||
}),
|
||||
}
|
||||
]
|
||||
},
|
||||
plugins: [
|
||||
new ExtractTextPlugin('../css/webslides.css')
|
||||
]
|
||||
};
|
||||
|
||||
module.exports = merge(require('./webpack.config.common'), dev);
|
@@ -1,10 +1,7 @@
|
||||
const ExtractTextPlugin = require('extract-text-webpack-plugin');
|
||||
const merge = require('webpack-merge');
|
||||
const path = require('path');
|
||||
const ExtractTextPlugin = require('extract-text-webpack-plugin');
|
||||
|
||||
const src = path.join(__dirname, 'src');
|
||||
|
||||
let config = {
|
||||
let prod = {
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
@@ -21,4 +18,4 @@ let config = {
|
||||
]
|
||||
};
|
||||
|
||||
module.exports = merge(require('./webpack.config.babel'), config);
|
||||
module.exports = merge(require('./webpack.config.common'), prod);
|
Reference in New Issue
Block a user