Skip to content

Commit

Permalink
Dev in sfe container & prod use /dist of sfe
Browse files Browse the repository at this point in the history
  • Loading branch information
thallada committed Feb 15, 2018
1 parent 15a70f2 commit 73cffad
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 20 deletions.
2 changes: 2 additions & 0 deletions cms/envs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1363,6 +1363,8 @@
}
}

STUDIO_FRONTEND_CONTAINER_URL = None

################################ Settings for Credit Course Requirements ################################
# Initial delay used for retrying tasks.
# Additional retries use longer delays.
Expand Down
17 changes: 12 additions & 5 deletions cms/templates/asset_index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,18 @@
<%namespace name='static' file='static_content.html'/>

<%block name="header_extras">
% for template_name in ["asset"]:
<script type="text/template" id="${template_name}-tpl">
<%static:include path="js/${template_name}.underscore" />
</script>
% endfor
% if waffle_flag_enabled:
% if not settings.STUDIO_FRONTEND_CONTAINER_URL:
<link rel="stylesheet" type="text/css" href="${static.url('common/css/vendor/vendor.min.css')}" />
<link rel="stylesheet" type="text/css" href="${static.url('common/css/vendor/assets.min.css')}" />
% endif
% else:
% for template_name in ["asset"]:
<script type="text/template" id="${template_name}-tpl">
<%static:include path="js/${template_name}.underscore" />
</script>
% endfor
% endif
</%block>

% if not waffle_flag_enabled:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,13 @@
var studioContext = ${ body | n, decode.utf8};
</script>
<div id="root"></div>
${HTML(render_bundle(page))}
% if settings.STUDIO_FRONTEND_CONTAINER_URL:
<script type="text/javascript" src="${settings.STUDIO_FRONTEND_CONTAINER_URL}/assets.js"></script>
% else:
<script type="text/javascript" src="${url('common/js/vendor/manifest.min.js')}"></script>
<script type="text/javascript" src="${url('common/js/vendor/vendor.min.js')}"></script>
<script type="text/javascript" src="${url('common/js/vendor/assets.min.js')}"></script>
% endif
</%def>

<%def name="webpack(entry, extension=None, config='DEFAULT', attrs='')">
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"dependencies": {
"@edx/edx-bootstrap": "0.4.3",
"@edx/paragon": "1.7.1",
"@edx/studio-frontend": "0.9.0",
"@edx/studio-frontend": "1.0.2",
"babel-core": "6.26.0",
"babel-loader": "6.4.1",
"babel-plugin-transform-class-properties": "6.24.1",
Expand Down
14 changes: 14 additions & 0 deletions pavelib/assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,20 @@
'requirejs/require.js',
'underscore.string/dist/underscore.string.js',
'underscore/underscore.js',
'@edx/studio-frontend/dist/manifest.min.js',
'@edx/studio-frontend/dist/manifest.min.js.map',
'@edx/studio-frontend/dist/vendor.min.js',
'@edx/studio-frontend/dist/vendor.min.js.map',
'@edx/studio-frontend/dist/vendor.min.css',
'@edx/studio-frontend/dist/vendor.min.css.map',
'@edx/studio-frontend/dist/assets.min.js',
'@edx/studio-frontend/dist/assets.min.js.map',
'@edx/studio-frontend/dist/assets.min.css',
'@edx/studio-frontend/dist/assets.min.css.map',
'@edx/studio-frontend/dist/accessibilityPolicy.min.js',
'@edx/studio-frontend/dist/accessibilityPolicy.min.js.map',
'@edx/studio-frontend/dist/accessibilityPolicy.min.css',
'@edx/studio-frontend/dist/accessibilityPolicy.min.css.map',
'which-country/index.js'
]

Expand Down
3 changes: 0 additions & 3 deletions webpack.common.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@ module.exports = {

entry: {
// Studio
AssetsPage: './node_modules/@edx/studio-frontend/src/index.jsx',
Import: './cms/static/js/features/import/factories/import.js',
CourseOrLibraryListing: './cms/static/js/features_jsx/studio/CourseOrLibraryListing.jsx',
AccessibilityPage: './node_modules/@edx/studio-frontend/src/accessibilityIndex.jsx',
'js/pages/login': './cms/static/js/pages/login.js',

// LMS
Expand Down Expand Up @@ -127,7 +125,6 @@ module.exports = {
{
test: /\.(js|jsx)$/,
include: [
/studio-frontend/,
/paragon/
],
use: 'babel-loader'
Expand Down
1 change: 0 additions & 1 deletion webpack.dev.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ module.exports = Merge.smart(commonConfig, {
{
test: /(.scss|.css)$/,
include: [
/studio-frontend/,
/paragon/,
/font-awesome/
],
Expand Down
2 changes: 0 additions & 2 deletions webpack.prod.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ module.exports = Merge.smart(commonConfig, {
},
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')
}),
Expand All @@ -33,7 +32,6 @@ module.exports = Merge.smart(commonConfig, {
{
test: /(.scss|.css)$/,
include: [
/studio-frontend/,
/paragon/,
/font-awesome/
],
Expand Down

0 comments on commit 73cffad

Please sign in to comment.