forked from openedx/edx-platform
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
EDUCATOR-1448 Modifies paver webpack task to use production configuration in all non-devstack environments, and a development config in devstack.
- Loading branch information
Eric Fischer
committed
Oct 26, 2017
1 parent
e712a2f
commit 3fc342e
Showing
11 changed files
with
153 additions
and
69 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* eslint-env node */ | ||
|
||
'use strict'; | ||
|
||
var Merge = require('webpack-merge'); | ||
var path = require('path'); | ||
var webpack = require('webpack'); | ||
|
||
var commonConfig = require('./webpack.common.config.js'); | ||
|
||
module.exports = Merge.smart(commonConfig, { | ||
output: { | ||
filename: '[name].js' | ||
}, | ||
devtool: 'source-map', | ||
plugins: [ | ||
new webpack.LoaderOptionsPlugin({ | ||
debug: true | ||
}), | ||
new webpack.DefinePlugin({ | ||
'process.env.NODE_ENV': JSON.stringify('development') | ||
}) | ||
], | ||
module: { | ||
rules: [ | ||
{ | ||
test: /(.scss|.css)$/, | ||
include: [ | ||
/studio-frontend/, | ||
/paragon/, | ||
/font-awesome/ | ||
], | ||
use: [{ | ||
loader: 'css-loader', | ||
options: { | ||
modules: true, | ||
localIdentName: '[name]__[local]___[hash:base64:5]' | ||
} | ||
}, { | ||
loader: 'sass-loader', | ||
options: { | ||
data: '$base-rem-size: 0.625; @import "paragon-reset";', | ||
includePaths: [ | ||
path.join(__dirname, './node_modules/@edx/paragon/src/utils'), | ||
path.join(__dirname, './node_modules/') | ||
], | ||
sourceMap: true | ||
} | ||
}] | ||
} | ||
] | ||
} | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* eslint-env node */ | ||
|
||
'use strict'; | ||
|
||
var Merge = require('webpack-merge'); | ||
var path = require('path'); | ||
var webpack = require('webpack'); | ||
|
||
var ExtractTextPlugin = require('extract-text-webpack-plugin'); | ||
var extractSass = new ExtractTextPlugin({ | ||
filename: 'css/[name].[contenthash].css' | ||
}); | ||
|
||
var commonConfig = require('./webpack.common.config.js'); | ||
|
||
module.exports = Merge.smart(commonConfig, { | ||
output: { | ||
filename: '[name].[chunkhash].js' | ||
}, | ||
devtool: false, | ||
plugins: [ | ||
new ExtractTextPlugin('node_modules/@edx/studio-frontend/dist/studio-frontend.min.css'), | ||
new webpack.DefinePlugin({ | ||
'process.env.NODE_ENV': JSON.stringify('production') | ||
}), | ||
new webpack.LoaderOptionsPlugin({ // This may not be needed; legacy option for loaders written for webpack 1 | ||
minimize: true | ||
}), | ||
new webpack.optimize.UglifyJsPlugin() | ||
], | ||
module: { | ||
rules: [ | ||
{ | ||
test: /(.scss|.css)$/, | ||
include: [ | ||
/studio-frontend/, | ||
/paragon/, | ||
/font-awesome/ | ||
], | ||
use: extractSass.extract({ | ||
use: [{ | ||
loader: 'css-loader', | ||
options: { | ||
modules: true, | ||
localIdentName: '[name]__[local]___[hash:base64:5]' | ||
} | ||
}, { | ||
loader: 'sass-loader', | ||
options: { | ||
data: '$base-rem-size: 0.625; @import "paragon-reset";', | ||
includePaths: [ | ||
path.join(__dirname, './node_modules/@edx/paragon/src/utils'), | ||
path.join(__dirname, './node_modules/') | ||
] | ||
} | ||
}], | ||
fallback: 'style-loader' | ||
}) | ||
} | ||
] | ||
} | ||
}); |