mirror of
https://github.com/digitalocean/nginxconfig.io.git
synced 2025-08-29 07:16:34 +08:00
Set dynamic webpack import path (#208)
* Set dynamic webpack import path * Cleanup
This commit is contained in:
committed by
GitHub
parent
0cefd5ddef
commit
479412888d
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright 2020 DigitalOcean
|
||||
Copyright 2021 DigitalOcean
|
||||
|
||||
This code is licensed under the MIT License.
|
||||
You may obtain a copy of the License at
|
||||
@@ -24,12 +24,22 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
// Dynamic webpack import location (must be before app)
|
||||
const originalSrcDir = document.currentScript.src.split('/').slice(0, -1).join('/');
|
||||
(typeof global === 'undefined' ? window : global).__replaceWebpackDynamicImport = path => {
|
||||
const base = path.split('/').pop();
|
||||
console.log(`Modifying import ${path} to use dir ${originalSrcDir} and base ${base}`);
|
||||
return `${originalSrcDir}/${base}`;
|
||||
};
|
||||
|
||||
// Load in the app
|
||||
import './scss/style.scss';
|
||||
import Vue from 'vue';
|
||||
import './util/prism_bundle';
|
||||
import { i18n } from './i18n/setup';
|
||||
import App from './templates/app';
|
||||
|
||||
// Run the app
|
||||
new Vue({
|
||||
i18n,
|
||||
render: h => h(App),
|
||||
|
Reference in New Issue
Block a user