0

My application uses django on the backend and Vuejs on the frontend (doesn't use vue-cli). So the index.js from Vue is used something like this in my base.html

{% compress js %}
  <script type="module" src="{% static 'path/to/index.js' %}"></script>
{% endcompress %}

Producing this -> index.4b6f970ead9c.js -> A compressed file in static/CACHE/js

I need to build source-maps as .map files which in the end will be uploaded to sentry.

Following is in my webpack.config.js :

devtool: 'source-map',
output: {
  sourceMapFilename: '[file].map',
}

Doing this, I get a warning on my console :

DevTools failed to load SourceMap: Could not load content for http://localhost:8000/static/CACHE/js/tmpy_nqoqkg.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE

I should expect the .map file to be in static/CACHE/js right? I couldn't any file with a .map extension anywhere in my app.

But in the end of this (index.4b6f970ead9c.js) compressed file that is loaded I do see a mapping : //# sourceMappingURL=tmpy_nqoqkg.js.map

Is there any way I can physically save the .map file for my application and use it later?

4
  • are you using awesome-typescript-loader? Commented Aug 11, 2020 at 10:39
  • nope using JavaScript, with babel-loader Commented Aug 11, 2020 at 10:40
  • Try defining output.path and output.publicPath to static/CACHE/js Commented Aug 11, 2020 at 10:43
  • Tried doing that, also tried using path.join(__dirname, 'static/CACHE/js') doesn't work Commented Aug 11, 2020 at 10:48

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.