Code Monkey home page Code Monkey logo

Comments (6)

s-KaiNet avatar s-KaiNet commented on August 20, 2024 2

Hi Ryan,
here is the solution for you (works for me with the latest CRA):

  1. Scaffold a project with the latest CRA
  2. Install npm install @rescripts/cli --save-dev
  3. In the root directory of your project create a file .rescriptsrc.js and put below code inside:
module.exports = config => {
    config.optimization.splitChunks.automaticNameDelimiter = '_';
    if (config.optimization.runtimeChunk) {
        config.optimization.runtimeChunk = {
            name: entrypoint => `runtime_${entrypoint.name}`
        };
    }
    return config;
};
  1. In package.json in sripts section add a new entry "build-re": "rescripts build"
  2. Now when running npm run build-re it will generate _ instead of ~ in file names.

More on rescripts here.

from spsave.

koltyakov avatar koltyakov commented on August 20, 2024 1

I tested in SPO and 2016. While it's banned in 2013, the only way is reconfiguring your CRA build or/and deploy pipeline to do not generate ~ in filenames.

from spsave.

koltyakov avatar koltyakov commented on August 20, 2024

Hi @rylew2,

Looks like something wrong with your initiation object. ~ should not be banned in SharePoint.

image

image

from spsave.

rylew2 avatar rylew2 commented on August 20, 2024

If I try to drag and drop the same file to a custom folder in SharePoint Designer it fails with the same invalid character message. This is SP2013 and spsave ^3.1.5

from spsave.

rylew2 avatar rylew2 commented on August 20, 2024

Ok thanks - I'll ask on SO: https://stackoverflow.com/questions/56203855/create-react-app-build-files-tilde-character

Hopefully there's a way to change config. Worst case I will revert to a previous version of CRA which doesn't use tilde. It only broke when I upgraded CRA.

from spsave.

rylew2 avatar rylew2 commented on August 20, 2024

Works like a charm - thank you @s-KaiNet !

from spsave.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.