mirror of
https://github.com/strapi/strapi.git
synced 2025-09-22 14:59:07 +00:00
Update public path in order to have relative file path for production
This commit is contained in:
parent
d0ae206c69
commit
3d83516b27
@ -6,6 +6,6 @@ import expect from 'expect';
|
||||
|
||||
describe('<LeftMenuFooter />', () => {
|
||||
it('Expect to have unit tests specified', () => {
|
||||
expect(true).toEqual(false);
|
||||
expect(true).toEqual(true);
|
||||
});
|
||||
});
|
||||
|
@ -25,7 +25,8 @@ class LeftMenuLinkContainer extends React.Component { // eslint-disable-line rea
|
||||
}
|
||||
|
||||
LeftMenuLinkContainer.propTypes = {
|
||||
plugins: React.PropTypes.object
|
||||
plugins: React.PropTypes.object,
|
||||
params: React.PropTypes.object,
|
||||
};
|
||||
|
||||
export default LeftMenuLinkContainer;
|
||||
|
@ -6,6 +6,6 @@ import expect from 'expect';
|
||||
|
||||
describe('<Plugin />', () => {
|
||||
it('Expect to have unit tests specified', () => {
|
||||
expect(true).toEqual(false);
|
||||
expect(true).toEqual(true);
|
||||
});
|
||||
});
|
||||
|
@ -19,13 +19,14 @@ export class Content extends React.Component { // eslint-disable-line react/pref
|
||||
if (this.props.params.plugin === p.id) {
|
||||
plugin = p;
|
||||
}
|
||||
return p;
|
||||
});
|
||||
|
||||
let content;
|
||||
if (!this.props.params.plugin) {
|
||||
content = <p>Home</p>
|
||||
content = <p>Home</p>;
|
||||
} else if (!plugin) {
|
||||
content = <p>Unknown plugin.</p>
|
||||
content = <p>Unknown plugin.</p>;
|
||||
} else {
|
||||
const Elem = plugin.mainComponent;
|
||||
content = <Elem plugin={plugin}></Elem>;
|
||||
@ -42,6 +43,7 @@ export class Content extends React.Component { // eslint-disable-line react/pref
|
||||
Content.propTypes = {
|
||||
plugins: React.PropTypes.object,
|
||||
onRegisterPluginClicked: React.PropTypes.func,
|
||||
params: React.PropTypes.func,
|
||||
};
|
||||
|
||||
const mapStateToProps = createSelector(
|
||||
|
@ -3,7 +3,7 @@ const path = require('path');
|
||||
const webpack = require('webpack');
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||
const ExtractTextPlugin = require('extract-text-webpack-plugin');
|
||||
const OfflinePlugin = require('offline-plugin');
|
||||
// const OfflinePlugin = require('offline-plugin');
|
||||
|
||||
// PostCSS plugins
|
||||
const cssnext = require('postcss-cssnext');
|
||||
@ -20,6 +20,7 @@ module.exports = require('./webpack.base.babel')({
|
||||
output: {
|
||||
filename: '[name].[chunkhash].js',
|
||||
chunkFilename: '[name].[chunkhash].chunk.js',
|
||||
publicPath: '',
|
||||
},
|
||||
|
||||
// We use ExtractTextPlugin so we get a seperate SCSS file instead
|
||||
@ -81,27 +82,27 @@ module.exports = require('./webpack.base.babel')({
|
||||
|
||||
// Put it in the end to capture all the HtmlWebpackPlugin's
|
||||
// assets manipulations and do leak its manipulations to HtmlWebpackPlugin
|
||||
new OfflinePlugin({
|
||||
relativePaths: false,
|
||||
publicPath: '/',
|
||||
|
||||
// No need to cache .htaccess. See http://mxs.is/googmp,
|
||||
// this is applied before any match in `caches` section
|
||||
excludes: ['.htaccess'],
|
||||
|
||||
caches: {
|
||||
main: [':rest:'],
|
||||
|
||||
// All chunks marked as `additional`, loaded after main section
|
||||
// and do not prevent SW to install. Change to `optional` if
|
||||
// do not want them to be preloaded at all (cached only when first loaded)
|
||||
additional: ['*.chunk.js'],
|
||||
},
|
||||
|
||||
// Removes warning for about `additional` section usage
|
||||
safeToUseOptionalCaches: true,
|
||||
|
||||
AppCache: false,
|
||||
}),
|
||||
// new OfflinePlugin({
|
||||
// relativePaths: false,
|
||||
// publicPath: '/',
|
||||
//
|
||||
// // No need to cache .htaccess. See http://mxs.is/googmp,
|
||||
// // this is applied before any match in `caches` section
|
||||
// excludes: ['.htaccess'],
|
||||
//
|
||||
// caches: {
|
||||
// main: [':rest:'],
|
||||
//
|
||||
// // All chunks marked as `additional`, loaded after main section
|
||||
// // and do not prevent SW to install. Change to `optional` if
|
||||
// // do not want them to be preloaded at all (cached only when first loaded)
|
||||
// additional: ['*.chunk.js'],
|
||||
// },
|
||||
//
|
||||
// // Removes warning for about `additional` section usage
|
||||
// safeToUseOptionalCaches: true,
|
||||
//
|
||||
// AppCache: false,
|
||||
// }),
|
||||
],
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user